Sha256: 7a26e2523ee90926730c2cd56c21a070d5eb832020c75d7c5c7d54baef7ec44b

Contents?: true

Size: 409 Bytes

Versions: 27

Compression:

Stored size: 409 Bytes

Contents

module Spotlight
  ##
  # Global spotlight configuration
  class Site < ActiveRecord::Base
    has_many :exhibits, -> { ordered_by_weight }
    has_many :roles, as: :resource

    belongs_to :masthead, dependent: :destroy, optional: true

    accepts_nested_attributes_for :masthead, update_only: true
    accepts_nested_attributes_for :exhibits

    def self.instance
      first || create
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
blacklight-spotlight-2.4.1 app/models/spotlight/site.rb
blacklight-spotlight-2.4.0 app/models/spotlight/site.rb
blacklight-spotlight-2.3.3 app/models/spotlight/site.rb
blacklight-spotlight-2.3.2 app/models/spotlight/site.rb
blacklight-spotlight-2.3.1 app/models/spotlight/site.rb
blacklight-spotlight-2.3.0 app/models/spotlight/site.rb
blacklight-spotlight-2.2.1 app/models/spotlight/site.rb
blacklight-spotlight-2.2.0 app/models/spotlight/site.rb
blacklight-spotlight-2.1.0 app/models/spotlight/site.rb
blacklight-spotlight-2.0.2 app/models/spotlight/site.rb
blacklight-spotlight-2.0.1 app/models/spotlight/site.rb
blacklight-spotlight-2.0.0 app/models/spotlight/site.rb
blacklight-spotlight-2.0.0.rc6 app/models/spotlight/site.rb
blacklight-spotlight-2.0.0.rc5 app/models/spotlight/site.rb
blacklight-spotlight-2.0.0.rc4 app/models/spotlight/site.rb
blacklight-spotlight-2.0.0.rc3 app/models/spotlight/site.rb
blacklight-spotlight-2.0.0.rc2 app/models/spotlight/site.rb
blacklight-spotlight-2.0.0.rc1 app/models/spotlight/site.rb
blacklight-spotlight-1.5.1 app/models/spotlight/site.rb
blacklight-spotlight-1.4.1 app/models/spotlight/site.rb