class ThinkingSphinx::ActiveRecord::ColumnSQLPresenter
Attributes
adapter[R]
associations[R]
column[R]
model[R]
Public Class Methods
new(model, column, adapter, associations)
click to toggle source
# File lib/thinking_sphinx/active_record/column_sql_presenter.rb, line 2 def initialize(model, column, adapter, associations) @model, @column, @adapter, @associations = model, column, adapter, associations end
Public Instance Methods
aggregate?()
click to toggle source
# File lib/thinking_sphinx/active_record/column_sql_presenter.rb, line 6 def aggregate? path.aggregate? rescue Joiner::AssociationNotFound false end
with_table()
click to toggle source
# File lib/thinking_sphinx/active_record/column_sql_presenter.rb, line 12 def with_table return __name if string? return nil unless exists? "#{associations.alias_for(__stack)}.#{adapter.quote __name}" end
Private Instance Methods
exists?()
click to toggle source
# File lib/thinking_sphinx/active_record/column_sql_presenter.rb, line 25 def exists? path.model.column_names.include?(column.__name.to_s) rescue Joiner::AssociationNotFound false end
path()
click to toggle source
# File lib/thinking_sphinx/active_record/column_sql_presenter.rb, line 31 def path Joiner::Path.new model, column.__stack end