Class: Spotlight::Resource
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spotlight::Resource
- Extended by:
- ActiveModel::Callbacks
- 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(**args) ⇒ Object
Enqueue an asynchronous reindexing job for this resource.
-
#save_and_index(reindex_options: {}, **args) ⇒ Object
Persist the record to the database, and trigger a reindex to solr.
Instance Method Details
#document_model ⇒ Object
48 49 50 |
# File 'app/models/spotlight/resource.rb', line 48 def document_model exhibit&.blacklight_config&.document_model end |
#reindex_later(**args) ⇒ Object
Enqueue an asynchronous reindexing job for this resource
44 45 46 |
# File 'app/models/spotlight/resource.rb', line 44 def reindex_later(**args) Spotlight::ReindexJob.perform_later(self, **args) end |
#save_and_index(reindex_options: {}, **args) ⇒ Object
Persist the record to the database, and trigger a reindex to solr
38 39 40 |
# File 'app/models/spotlight/resource.rb', line 38 def save_and_index(reindex_options: {}, **args) save(*args) && reindex_later(**) end |