Class: Spotlight::Exhibit

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
FriendlyId
Includes:
ExhibitAnalytics, ExhibitDefaults, ExhibitDocuments, Translatables
Defined in:
app/models/spotlight/exhibit.rb

Overview

Spotlight exhibit

Instance Method Summary collapse

Methods included from ExhibitDocuments

#solr_documents

Methods included from ExhibitAnalytics

#analytics, #page_analytics

Instance Method Details

#available_localesObject



128
129
130
# File 'app/models/spotlight/exhibit.rb', line 128

def available_locales
  @available_locales ||= languages.pluck(:locale)
end

#browse_categories?Boolean

Returns:

  • (Boolean)


89
90
91
# File 'app/models/spotlight/exhibit.rb', line 89

def browse_categories?
  searches.published.any?
end

#import(hash) ⇒ Object



97
98
99
100
# File 'app/models/spotlight/exhibit.rb', line 97

def import(hash)
  Spotlight::ExhibitExportSerializer.prepare(self).from_hash(hash)
  self
end

#main_about_pageObject



85
86
87
# File 'app/models/spotlight/exhibit.rb', line 85

def main_about_page
  @main_about_page ||= about_pages.for_locale.published.first
end

#reindex_later(user = nil) ⇒ Object



108
109
110
# File 'app/models/spotlight/exhibit.rb', line 108

def reindex_later(user = nil)
  Spotlight::ReindexJob.perform_later(self, new_reindexing_log_entry(user))
end

#reindex_progressObject



124
125
126
# File 'app/models/spotlight/exhibit.rb', line 124

def reindex_progress
  @reindex_progress ||= ReindexProgress.new(current_reindexing_log_entry)
end

#requested_byObject



120
121
122
# File 'app/models/spotlight/exhibit.rb', line 120

def requested_by
  roles.first.user if roles.first
end

#searchable?Boolean

Returns:

  • (Boolean)


116
117
118
# File 'app/models/spotlight/exhibit.rb', line 116

def searchable?
  blacklight_config.search_fields.any? { |_k, v| v.enabled && v.include_in_simple_select != false }
end

#solr_dataObject



102
103
104
105
106
# File 'app/models/spotlight/exhibit.rb', line 102

def solr_data
  filters.each_with_object({}) do |filter, hash|
    hash.merge! filter.to_hash
  end
end

#to_sObject



93
94
95
# File 'app/models/spotlight/exhibit.rb', line 93

def to_s
  title
end

#uploaded_resource_fieldsObject



112
113
114
# File 'app/models/spotlight/exhibit.rb', line 112

def uploaded_resource_fields
  Spotlight::Engine.config.upload_fields
end