Class: Spotlight::Exhibit
Overview
Instance Method Summary
collapse
#solr_documents
#analytics, #page_analytics
Instance Method Details
#available_locales ⇒ Object
115
116
117
|
# File 'app/models/spotlight/exhibit.rb', line 115
def available_locales
@available_locales ||= languages.pluck(:locale)
end
|
#browse_categories? ⇒ Boolean
76
77
78
|
# File 'app/models/spotlight/exhibit.rb', line 76
def browse_categories?
searches.published.any?
end
|
#import(hash) ⇒ Object
84
85
86
87
|
# File 'app/models/spotlight/exhibit.rb', line 84
def import(hash)
Spotlight::ExhibitExportSerializer.prepare(self).from_hash(hash)
self
end
|
#main_about_page ⇒ Object
72
73
74
|
# File 'app/models/spotlight/exhibit.rb', line 72
def main_about_page
@main_about_page ||= about_pages.for_locale.published.first
end
|
#reindex_later(user = nil) ⇒ Object
95
96
97
|
# File 'app/models/spotlight/exhibit.rb', line 95
def reindex_later(user = nil)
Spotlight::ReindexJob.perform_later(self, new_reindexing_log_entry(user))
end
|
#reindex_progress ⇒ Object
111
112
113
|
# File 'app/models/spotlight/exhibit.rb', line 111
def reindex_progress
@reindex_progress ||= ReindexProgress.new(current_reindexing_log_entry)
end
|
#requested_by ⇒ Object
107
108
109
|
# File 'app/models/spotlight/exhibit.rb', line 107
def requested_by
roles.first.user if roles.first
end
|
#searchable? ⇒ Boolean
103
104
105
|
# File 'app/models/spotlight/exhibit.rb', line 103
def searchable?
blacklight_config.search_fields.any? { |_k, v| v.enabled && v.include_in_simple_select != false }
end
|
#solr_data ⇒ Object
89
90
91
92
93
|
# File 'app/models/spotlight/exhibit.rb', line 89
def solr_data
filters.each_with_object({}) do |filter, hash|
hash.merge! filter.to_hash
end
end
|
#to_s ⇒ Object
80
81
82
|
# File 'app/models/spotlight/exhibit.rb', line 80
def to_s
title
end
|
#uploaded_resource_fields ⇒ Object
99
100
101
|
# File 'app/models/spotlight/exhibit.rb', line 99
def uploaded_resource_fields
Spotlight::Engine.config.upload_fields
end
|