cacheable_query(klass, arel)
public
This is used in the StatementCache object. It returns an object that can be
used to query
the database repeatedly.
# File activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb, line 56
def cacheable_query(klass, arel) # :nodoc:
if prepared_statements
sql, binds = visitor.compile(arel.ast, collector)
query = klass.query(sql)
else
collector = klass.partial_query_collector
parts, binds = visitor.compile(arel.ast, collector)
query = klass.partial_query(parts)
end
[query, binds]
end