notebook/app/models/attribute.rb
2018-08-18 16:49:17 -05:00

14 lines
376 B
Ruby

class Attribute < ApplicationRecord
acts_as_paranoid
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