Class: Spotlight::Exhibit
Overview
Instance Method Summary
collapse
#solr_documents
#analytics, #page_analytics
Instance Method Details
#browse_categories? ⇒ Boolean
65
66
67
|
# File 'app/models/spotlight/exhibit.rb', line 65
def browse_categories?
searches.published.any?
end
|
#import(hash) ⇒ Object
73
74
75
76
|
# File 'app/models/spotlight/exhibit.rb', line 73
def import(hash)
Spotlight::ExhibitExportSerializer.prepare(self).from_hash(hash)
self
end
|
#main_about_page ⇒ Object
61
62
63
|
# File 'app/models/spotlight/exhibit.rb', line 61
def main_about_page
@main_about_page ||= about_pages.published.first
end
|
#reindex_later(user = nil) ⇒ Object
84
85
86
|
# File 'app/models/spotlight/exhibit.rb', line 84
def reindex_later(user = nil)
Spotlight::ReindexJob.perform_later(self, new_reindexing_log_entry(user))
end
|
#reindex_progress ⇒ Object
100
101
102
|
# File 'app/models/spotlight/exhibit.rb', line 100
def reindex_progress
@reindex_progress ||= ReindexProgress.new(current_reindexing_log_entry)
end
|
#requested_by ⇒ Object
96
97
98
|
# File 'app/models/spotlight/exhibit.rb', line 96
def requested_by
roles.first.user if roles.first
end
|
#searchable? ⇒ Boolean
92
93
94
|
# File 'app/models/spotlight/exhibit.rb', line 92
def searchable?
blacklight_config.search_fields.any? { |_k, v| v.enabled && v.include_in_simple_select != false }
end
|
#solr_data ⇒ Object
78
79
80
81
82
|
# File 'app/models/spotlight/exhibit.rb', line 78
def solr_data
filters.each_with_object({}) do |filter, hash|
hash.merge! filter.to_hash
end
end
|
#to_s ⇒ Object
69
70
71
|
# File 'app/models/spotlight/exhibit.rb', line 69
def to_s
title
end
|
#uploaded_resource_fields ⇒ Object
88
89
90
|
# File 'app/models/spotlight/exhibit.rb', line 88
def uploaded_resource_fields
Spotlight::Engine.config.upload_fields
end
|