Sha256: ee2514a0efc914ec4e33f4210384b55c4142442c7ae0db4cde8c2fe149b59b1d

Contents?: true

Size: 440 Bytes

Versions: 76

Compression:

Stored size: 440 Bytes

Contents

# frozen_string_literal: true

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

76 entries across 76 versions & 1 rubygems

Version Path
blacklight-spotlight-2.13.0 app/models/spotlight/site.rb
blacklight-spotlight-2.12.1 app/models/spotlight/site.rb
blacklight-spotlight-2.12.0 app/models/spotlight/site.rb
blacklight-spotlight-2.11.0 app/models/spotlight/site.rb
blacklight-spotlight-2.10.0 app/models/spotlight/site.rb
blacklight-spotlight-2.9.0 app/models/spotlight/site.rb
blacklight-spotlight-2.8.0 app/models/spotlight/site.rb
blacklight-spotlight-2.7.2 app/models/spotlight/site.rb
blacklight-spotlight-2.7.1 app/models/spotlight/site.rb
blacklight-spotlight-2.7.0 app/models/spotlight/site.rb
blacklight-spotlight-2.6.1.1 app/models/spotlight/site.rb
blacklight-spotlight-2.6.1 app/models/spotlight/site.rb
blacklight-spotlight-2.6.0 app/models/spotlight/site.rb
blacklight-spotlight-2.5.2 app/models/spotlight/site.rb
blacklight-spotlight-2.5.1 app/models/spotlight/site.rb
blacklight-spotlight-2.5.0 app/models/spotlight/site.rb