Class: Spotlight::Resource
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spotlight::Resource
- Extended by:
- ActiveModel::Callbacks
- Includes:
- ActiveSupport::Benchmarkable, SolrDocument::AtomicUpdates
- Defined in:
- app/models/spotlight/resource.rb
Overview
Exhibit resources
Direct Known Subclasses
Instance Method Summary collapse
-
#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.
Methods included from SolrDocument::AtomicUpdates
Instance Method Details
#reindex_later ⇒ Object
Enqueue an asynchronous reindexing job for this resource
37 38 39 40 |
# File 'app/models/spotlight/resource.rb', line 37 def reindex_later waiting! Spotlight::ReindexJob.perform_later(self) end |
#save_and_index(*args) ⇒ Object
Persist the record to the database, and trigger a reindex to solr
31 32 33 |
# File 'app/models/spotlight/resource.rb', line 31 def save_and_index(*args) save(*args) && reindex_later end |