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
49 50 51 |
# File 'app/models/spotlight/resource.rb', line 49 def document_model exhibit&.blacklight_config&.document_model end |
#reindex_later(**args) ⇒ Object
Enqueue an asynchronous reindexing job for this resource
45 46 47 |
# File 'app/models/spotlight/resource.rb', line 45 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
39 40 41 |
# File 'app/models/spotlight/resource.rb', line 39 def save_and_index(reindex_options: {}, **args) save(*args) && reindex_later(**) end |