Class: Spotlight::Resource
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spotlight::Resource
- Extended by:
- ActiveModel::Callbacks
- Includes:
- ActiveSupport::Benchmarkable
- Defined in:
- app/models/spotlight/resource.rb
Overview
Exhibit resources
Direct Known Subclasses
Spotlight::Resources::IiifHarvester, Spotlight::Resources::JsonUpload, Spotlight::Resources::Upload
Instance Method Summary collapse
- #document_model ⇒ Object
-
#reindex_later ⇒ Object
Enqueue an asynchronous reindexing job for this resource.
-
#save_and_index(*args) ⇒ Object
Persist the record to the database, and trigger a reindex to solr.
Instance Method Details
#document_model ⇒ Object
37 38 39 |
# File 'app/models/spotlight/resource.rb', line 37 def document_model exhibit.blacklight_config.document_model if exhibit end |
#reindex_later ⇒ Object
Enqueue an asynchronous reindexing job for this resource
33 34 35 |
# File 'app/models/spotlight/resource.rb', line 33 def reindex_later Spotlight::ReindexJob.perform_later(self) end |
#save_and_index(*args) ⇒ Object
Persist the record to the database, and trigger a reindex to solr
27 28 29 |
# File 'app/models/spotlight/resource.rb', line 27 def save_and_index(*args) save(*args) && reindex_later end |