Class: Spotlight::SolrDocumentSidecar
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spotlight::SolrDocumentSidecar
- Defined in:
- app/models/spotlight/solr_document_sidecar.rb
Overview
Exhibit-specific metadata for indexed documents
Instance Method Summary collapse
- #default_document_type ⇒ Object
-
#document ⇒ Object
Roll our own polymorphism because our documents are not AREL-able.
- #document_type ⇒ Object
- #private! ⇒ Object
- #public! ⇒ Object
- #to_solr ⇒ Object
Instance Method Details
#default_document_type ⇒ Object
32 33 34 |
# File 'app/models/spotlight/solr_document_sidecar.rb', line 32 def default_document_type blacklight_config.document_model end |
#document ⇒ Object
Roll our own polymorphism because our documents are not AREL-able
24 25 26 |
# File 'app/models/spotlight/solr_document_sidecar.rb', line 24 def document document_type.new document_type.unique_key => document_id end |
#document_type ⇒ Object
28 29 30 |
# File 'app/models/spotlight/solr_document_sidecar.rb', line 28 def document_type (super.constantize if defined?(super)) || default_document_type end |
#private! ⇒ Object
15 16 17 |
# File 'app/models/spotlight/solr_document_sidecar.rb', line 15 def private! update public: false end |
#public! ⇒ Object
19 20 21 |
# File 'app/models/spotlight/solr_document_sidecar.rb', line 19 def public! update public: true end |
#to_solr ⇒ Object
11 12 13 |
# File 'app/models/spotlight/solr_document_sidecar.rb', line 11 def to_solr { document.class.unique_key.to_sym => document.id, visibility_field => public? }.merge(data_to_solr) end |