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
|
#import(hash) ⇒ Object
71
72
73
74
|
# File 'app/models/spotlight/exhibit.rb', line 71
def import(hash)
Spotlight::ExhibitExportSerializer.prepare(self).from_hash(hash)
self
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
80
81
82
|
# File 'app/models/spotlight/exhibit.rb', line 80
def reindex_later
Spotlight::ReindexJob.perform_later(self)
end
|
#searchable? ⇒ Boolean
88
89
90
|
# File 'app/models/spotlight/exhibit.rb', line 88
def searchable?
blacklight_config.search_fields.any? { |_k, v| v.enabled && v.include_in_simple_select != false }
end
|
#set_default_thumbnail ⇒ Object
92
93
94
|
# File 'app/models/spotlight/exhibit.rb', line 92
def set_default_thumbnail
self.thumbnail ||= searches.first.try(:thumbnail)
end
|
#solr_data ⇒ Object
76
77
78
|
# File 'app/models/spotlight/exhibit.rb', line 76
def solr_data
{ :"#{Spotlight::Engine.config.solr_fields.prefix}spotlight_exhibit_slug_#{slug}#{Spotlight::Engine.config.solr_fields.boolean_suffix}" => true }
end
|
#to_s ⇒ Object
67
68
69
|
# File 'app/models/spotlight/exhibit.rb', line 67
def to_s
title
end
|
#uploaded_resource_fields ⇒ Object
84
85
86
|
# File 'app/models/spotlight/exhibit.rb', line 84
def uploaded_resource_fields
Spotlight::Engine.config.upload_fields
end
|