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