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
Returns a new instance of PropertySQLPresenter.
6 7 8 |
# File 'lib/thinking_sphinx/active_record/property_sql_presenter.rb', line 6 def initialize(property, adapter, associations) @property, @adapter, @associations = property, adapter, associations end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
4 5 6 |
# File 'lib/thinking_sphinx/active_record/property_sql_presenter.rb', line 4 def adapter @adapter end |
#associations ⇒ Object (readonly)
Returns the value of attribute associations.
4 5 6 |
# File 'lib/thinking_sphinx/active_record/property_sql_presenter.rb', line 4 def associations @associations end |
#property ⇒ Object (readonly)
Returns the value of attribute property.
4 5 6 |
# File 'lib/thinking_sphinx/active_record/property_sql_presenter.rb', line 4 def property @property end |
Instance Method Details
#to_group ⇒ Object
10 11 12 13 14 |
# File 'lib/thinking_sphinx/active_record/property_sql_presenter.rb', line 10 def to_group return nil if sourced_by_query? || !group? columns_with_table end |
#to_select ⇒ Object
16 17 18 19 20 |
# File 'lib/thinking_sphinx/active_record/property_sql_presenter.rb', line 16 def to_select return nil if sourced_by_query? "#{casted_column_with_table} AS #{adapter.quote property.name}" end |