Class: Sunspot::Query::Restriction::SameAs
- Defined in:
- lib/sunspot/query/restriction.rb
Overview
Result must be the exact instance given (only useful when negated).
Instance Method Summary collapse
-
#initialize(object, negative = false) ⇒ SameAs
constructor
A new instance of SameAs.
- #to_positive_boolean_phrase ⇒ Object
Methods inherited from Base
#to_boolean_phrase, #to_negative_boolean_phrase, #to_params
Constructor Details
#initialize(object, negative = false) ⇒ SameAs
Returns a new instance of SameAs.
214 215 216 |
# File 'lib/sunspot/query/restriction.rb', line 214 def initialize(object, negative = false) @object, @negative = object, negative end |
Instance Method Details
#to_positive_boolean_phrase ⇒ Object
218 219 220 221 |
# File 'lib/sunspot/query/restriction.rb', line 218 def to_positive_boolean_phrase adapter = Adapters::InstanceAdapter.adapt(@object) "id:#{escape(adapter.index_id)}" end |