Class: ThinkingSphinx::ActiveRecord::PropertySQLPresenter
- Inherits:
-
Object
- Object
- ThinkingSphinx::ActiveRecord::PropertySQLPresenter
- Defined in:
- lib/thinking_sphinx/active_record/property_sql_presenter.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#associations ⇒ Object
readonly
Returns the value of attribute associations.
-
#property ⇒ Object
readonly
Returns the value of attribute property.
Instance Method Summary collapse
-
#initialize(property, adapter, associations) ⇒ PropertySQLPresenter
constructor
A new instance of PropertySQLPresenter.
- #to_group ⇒ Object
- #to_select ⇒ Object
Constructor Details
#initialize(property, adapter, associations) ⇒ PropertySQLPresenter
4 5 6 |
# File 'lib/thinking_sphinx/active_record/property_sql_presenter.rb', line 4 def initialize(property, adapter, associations) @property, @adapter, @associations = property, adapter, associations end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
2 3 4 |
# File 'lib/thinking_sphinx/active_record/property_sql_presenter.rb', line 2 def adapter @adapter end |
#associations ⇒ Object (readonly)
Returns the value of attribute associations.
2 3 4 |
# File 'lib/thinking_sphinx/active_record/property_sql_presenter.rb', line 2 def associations @associations end |
#property ⇒ Object (readonly)
Returns the value of attribute property.
2 3 4 |
# File 'lib/thinking_sphinx/active_record/property_sql_presenter.rb', line 2 def property @property end |
Instance Method Details
#to_group ⇒ Object
8 9 10 11 12 |
# File 'lib/thinking_sphinx/active_record/property_sql_presenter.rb', line 8 def to_group return nil if sourced_by_query? || !group? columns_with_table end |
#to_select ⇒ Object
14 15 16 17 18 |
# File 'lib/thinking_sphinx/active_record/property_sql_presenter.rb', line 14 def to_select return nil if sourced_by_query? "#{casted_column_with_table} AS #{adapter.quote property.name}" end |