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-4.3.6 app/models/spotlight/site.rb
blacklight-spotlight-4.3.5 app/models/spotlight/site.rb
blacklight-spotlight-4.3.4 app/models/spotlight/site.rb
blacklight-spotlight-4.3.3 app/models/spotlight/site.rb
blacklight-spotlight-4.3.2 app/models/spotlight/site.rb
blacklight-spotlight-4.3.1 app/models/spotlight/site.rb
blacklight-spotlight-4.3.0 app/models/spotlight/site.rb
blacklight-spotlight-4.2.0 app/models/spotlight/site.rb
blacklight-spotlight-4.1.2 app/models/spotlight/site.rb
blacklight-spotlight-4.1.1 app/models/spotlight/site.rb
blacklight-spotlight-4.1.0 app/models/spotlight/site.rb
blacklight-spotlight-4.0.3 app/models/spotlight/site.rb
blacklight-spotlight-4.0.2 app/models/spotlight/site.rb
blacklight-spotlight-4.0.1 app/models/spotlight/site.rb
blacklight-spotlight-4.0.0 app/models/spotlight/site.rb
blacklight-spotlight-3.6.0.beta10 app/models/spotlight/site.rb
blacklight-spotlight-3.6.0.beta9 app/models/spotlight/site.rb
blacklight-spotlight-3.6.0.beta8 app/models/spotlight/site.rb
blacklight-spotlight-3.5.0.4 app/models/spotlight/site.rb
blacklight-spotlight-3.6.0.beta7 app/models/spotlight/site.rb