notebook/app/models/attribute.rb
Andrew Brown 1a666a9654 oops
2018-07-05 01:19:03 -05:00

12 lines
356 B
Ruby

class Attribute < ApplicationRecord
belongs_to :user
belongs_to :attribute_field
belongs_to :entity, polymorphic: true
include Authority::Abilities
self.authorizer_name = 'AttributeAuthorizer'
include HasPrivacy
scope :is_public, -> { eager_load(:universe).where('universes.privacy = ? OR attributes.privacy = ?', 'public', 'public') }
end