Module: Spotlight::SolrDocument::Finder

Extended by:
ActiveSupport::Concern
Included in:
Spotlight::SolrDocument
Defined in:
app/models/concerns/spotlight/solr_document/finder.rb

Overview

Finder methods for SolrDocuments

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object

Returns true if comparison_object is the same exact object, or comparison_object is of the same type and self has an ID and it is equal to comparison_object.id.

Note that new records are different from any other record by definition, unless the other record is the receiver itself. Besides, if you fetch existing records with select and leave the ID out, you’re on your own, this predicate will return false.

Note also that destroying a record preserves its ID in the model instance, so deleted models are still comparable.



52
53
54
55
56
57
# File 'app/models/concerns/spotlight/solr_document/finder.rb', line 52

def ==(other)
  super ||
    (other.instance_of?(self.class) &&
      id &&
      other.id == id)
end

#blacklight_solrObject



59
60
61
# File 'app/models/concerns/spotlight/solr_document/finder.rb', line 59

def blacklight_solr
  self.class.index.connection
end