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