app/models/spotlight/search.rb in blacklight-spotlight-3.0.0.rc2 vs app/models/spotlight/search.rb in blacklight-spotlight-3.0.0.rc3
- old
+ new
@@ -10,12 +10,17 @@
extend FriendlyId
friendly_id :title, use: %i[slugged scoped finders history], scope: :exhibit
self.table_name = 'spotlight_searches'
belongs_to :exhibit
+ has_many :group_memberships, class_name: 'Spotlight::GroupMember', as: :member, dependent: :delete_all
+ has_many :groups, through: :group_memberships
+ accepts_nested_attributes_for :group_memberships
+ accepts_nested_attributes_for :groups
serialize :query_params, Hash
default_scope { order('weight ASC') }
scope :published, -> { where(published: true) }
+ scope :unpublished, -> { where(published: [nil, false]) }
validates :title, presence: true
translates :title, :subtitle, :long_description
has_paper_trail