Class: Spotlight::Exhibit
Overview
Instance Method Summary
collapse
#solr_documents
#analytics, #page_analytics
Instance Method Details
#browse_categories? ⇒ Boolean
63
64
65
|
# File 'app/models/spotlight/exhibit.rb', line 63
def browse_categories?
searches.published.any?
end
|
#main_about_page ⇒ Object
59
60
61
|
# File 'app/models/spotlight/exhibit.rb', line 59
def main_about_page
@main_about_page ||= about_pages.published.first
end
|
#reindex_later ⇒ Object
82
83
84
|
# File 'app/models/spotlight/exhibit.rb', line 82
def reindex_later
Spotlight::ReindexJob.perform_later(self)
end
|
#reindex_progress ⇒ Object
102
103
104
|
# File 'app/models/spotlight/exhibit.rb', line 102
def reindex_progress
@reindex_progress ||= ReindexProgress.new(resources) if resources
end
|
#requested_by ⇒ Object
98
99
100
|
# File 'app/models/spotlight/exhibit.rb', line 98
def requested_by
roles.first.user if roles.first
end
|
#searchable? ⇒ Boolean
90
91
92
|
# File 'app/models/spotlight/exhibit.rb', line 90
def searchable?
blacklight_config.search_fields.any? { |_k, v| v.enabled && v.include_in_simple_select != false }
end
|
#set_default_thumbnail ⇒ Object
94
95
96
|
# File 'app/models/spotlight/exhibit.rb', line 94
def set_default_thumbnail
self.thumbnail ||= searches.first.try(:thumbnail)
end
|
#solr_data ⇒ Object
76
77
78
79
80
|
# File 'app/models/spotlight/exhibit.rb', line 76
def solr_data
filters.each_with_object({}) do |filter, hash|
hash.merge! filter.to_hash
end
end
|
#to_s ⇒ Object
67
68
69
|
# File 'app/models/spotlight/exhibit.rb', line 67
def to_s
title
end
|
#uploaded_resource_fields ⇒ Object
86
87
88
|
# File 'app/models/spotlight/exhibit.rb', line 86
def uploaded_resource_fields
Spotlight::Engine.config.upload_fields
end
|