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-3.5.0.3 app/models/spotlight/site.rb
blacklight-spotlight-3.6.0.beta6 app/models/spotlight/site.rb
blacklight-spotlight-3.6.0.beta5 app/models/spotlight/site.rb
blacklight-spotlight-3.6.0.beta4 app/models/spotlight/site.rb
blacklight-spotlight-3.6.0.beta3 app/models/spotlight/site.rb
blacklight-spotlight-3.6.0.beta1 app/models/spotlight/site.rb
blacklight-spotlight-3.5.0.2 app/models/spotlight/site.rb
blacklight-spotlight-3.5.0.1 app/models/spotlight/site.rb
blacklight-spotlight-3.5.0 app/models/spotlight/site.rb
blacklight-spotlight-3.4.4.1 app/models/spotlight/site.rb
blacklight-spotlight-3.4.4 app/models/spotlight/site.rb
blacklight-spotlight-3.4.3 app/models/spotlight/site.rb
blacklight-spotlight-3.4.2.2 app/models/spotlight/site.rb
blacklight-spotlight-3.4.2.1 app/models/spotlight/site.rb
blacklight-spotlight-3.4.2 app/models/spotlight/site.rb
blacklight-spotlight-3.4.1 app/models/spotlight/site.rb
blacklight-spotlight-3.4.0 app/models/spotlight/site.rb
blacklight-spotlight-3.3.0 app/models/spotlight/site.rb
blacklight-spotlight-3.2.0 app/models/spotlight/site.rb
blacklight-spotlight-3.1.0 app/models/spotlight/site.rb