notebook/app/models/attribute.rb
2016-10-25 10:43:18 -07:00

9 lines
278 B
Ruby

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