diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-09 15:45:05 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-09 15:45:05 -0700 |
commit | 42a1bf18f28c97f6f059c6edcc8f0c3732dbba71 (patch) | |
tree | 6406c09190c10e4dd868630cbaf88085ffc4d87d /activerecord/lib/active_record/statement_cache.rb | |
parent | 70bd5eb4bb8d4b0e285bacb397f0ce39e9d5d1d1 (diff) | |
download | rails-42a1bf18f28c97f6f059c6edcc8f0c3732dbba71.tar.gz rails-42a1bf18f28c97f6f059c6edcc8f0c3732dbba71.tar.bz2 rails-42a1bf18f28c97f6f059c6edcc8f0c3732dbba71.zip |
working against arel/collector branch
Diffstat (limited to 'activerecord/lib/active_record/statement_cache.rb')
-rw-r--r-- | activerecord/lib/active_record/statement_cache.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/statement_cache.rb b/activerecord/lib/active_record/statement_cache.rb index 183e795e8f..c89dd48642 100644 --- a/activerecord/lib/active_record/statement_cache.rb +++ b/activerecord/lib/active_record/statement_cache.rb @@ -28,7 +28,7 @@ module ActiveRecord class PartialQuery < Query def sql_for(binds, connection) - @sql.gsub(/\?/) { connection.quote(*binds.shift.reverse) } + @sql.compile binds, connection end end @@ -36,9 +36,9 @@ module ActiveRecord Query.new visitor.accept(ast, Arel::Collectors::SQLString.new).value end - def self.partial_query(visitor, ast) - sql = visitor.accept(ast) { "?" } - PartialQuery.new sql + def self.partial_query(visitor, ast, collector) + collected = visitor.accept(ast, collector) + PartialQuery.new collected end class Params |