Module: ScopedSearch::QueryBuilder::Field

Defined in:
lib/scoped_search/query_builder.rb

Instance Method Summary collapse

Instance Method Details

#to_sql(operator = nil) {|:include, relation| ... } ⇒ Object

Return an SQL representation for this field

Yields:

  • (:include, relation)


123
124
125
126
127
# File 'lib/scoped_search/query_builder.rb', line 123

def to_sql(operator = nil, &block)
  yield(:include, relation) if relation
  definition.klass.connection.quote_table_name(klass.table_name) + "." + 
      definition.klass.connection.quote_column_name(field)
end