Class: ThinkingSphinx::ActiveRecord::PropertyQuery
- Inherits:
-
Object
- Object
- ThinkingSphinx::ActiveRecord::PropertyQuery
- Defined in:
- lib/thinking_sphinx/active_record/property_query.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(property, source, type = nil) ⇒ PropertyQuery
constructor
A new instance of PropertyQuery.
- #to_s ⇒ Object
Constructor Details
#initialize(property, source, type = nil) ⇒ PropertyQuery
Returns a new instance of PropertyQuery.
4 5 6 |
# File 'lib/thinking_sphinx/active_record/property_query.rb', line 4 def initialize(property, source, type = nil) @property, @source, @type = property, source, type end |
Instance Method Details
#to_s ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/thinking_sphinx/active_record/property_query.rb', line 8 def to_s if unsafe_habtm_column? raise <<-MESSAGE Source queries cannot be used with HABTM joins if they use anything beyond the primary key. MESSAGE end if safe_habtm_column? ThinkingSphinx::ActiveRecord::SimpleManyQuery.new( property, source, type ).to_s else "#{identifier} from #{source_type}; #{queries.join('; ')}" end end |