Sha256: 15ce0da20592156e50f2c5781d38ba19b412ef3ece608424e4f30e12a2676652

Contents?: true

Size: 670 Bytes

Versions: 53

Compression:

Stored size: 670 Bytes

Contents

# frozen_string_literal: true

module Spotlight
  ##
  # Exhibit saved searches
  class Group < ActiveRecord::Base
    include Spotlight::Translatables

    extend FriendlyId
    friendly_id :title, use: %i[slugged scoped finders history], scope: [:exhibit]
    translates :title

    self.table_name = 'spotlight_groups'
    belongs_to :exhibit
    has_many :group_members
    has_many :searches, through: :group_members, source: :member, source_type: 'Spotlight::Search'
    default_scope { order('weight ASC') }
    scope :published, -> { where(published: true) }
    accepts_nested_attributes_for :group_members
    accepts_nested_attributes_for :searches
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
blacklight-spotlight-4.7.0 app/models/spotlight/group.rb
blacklight-spotlight-4.6.1 app/models/spotlight/group.rb
blacklight-spotlight-4.6.0 app/models/spotlight/group.rb
blacklight-spotlight-4.5.0 app/models/spotlight/group.rb
blacklight-spotlight-4.4.0 app/models/spotlight/group.rb
blacklight-spotlight-4.3.6 app/models/spotlight/group.rb
blacklight-spotlight-4.3.5 app/models/spotlight/group.rb
blacklight-spotlight-4.3.4 app/models/spotlight/group.rb
blacklight-spotlight-4.3.3 app/models/spotlight/group.rb
blacklight-spotlight-4.3.2 app/models/spotlight/group.rb
blacklight-spotlight-4.3.1 app/models/spotlight/group.rb
blacklight-spotlight-4.3.0 app/models/spotlight/group.rb
blacklight-spotlight-4.2.0 app/models/spotlight/group.rb
blacklight-spotlight-4.1.2 app/models/spotlight/group.rb
blacklight-spotlight-4.1.1 app/models/spotlight/group.rb
blacklight-spotlight-4.1.0 app/models/spotlight/group.rb
blacklight-spotlight-4.0.3 app/models/spotlight/group.rb
blacklight-spotlight-4.0.2 app/models/spotlight/group.rb
blacklight-spotlight-4.0.1 app/models/spotlight/group.rb
blacklight-spotlight-4.0.0 app/models/spotlight/group.rb