aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-04-09 11:06:47 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-04-09 11:06:47 -0700
commita14f746bf0aac3f5e21b8d5b5d9672ba0d1dd979 (patch)
tree7ec1a9fb9a9c8127e87a5d643ecb381ab958c8f4 /activerecord/lib/active_record
parentdb5e578b647e1730ea2aecb1ca58fd9a434f6cf6 (diff)
downloadrails-a14f746bf0aac3f5e21b8d5b5d9672ba0d1dd979.tar.gz
rails-a14f746bf0aac3f5e21b8d5b5d9672ba0d1dd979.tar.bz2
rails-a14f746bf0aac3f5e21b8d5b5d9672ba0d1dd979.zip
use the compile method so we do not have to specify the collectors in this case
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb3
-rw-r--r--activerecord/lib/active_record/relation.rb3
2 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
index fdb6fbeeb4..7cd825abb9 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
@@ -10,10 +10,9 @@ module ActiveRecord
def to_sql(arel, binds = [])
if arel.respond_to?(:ast)
binds = binds.dup
- c = visitor.accept(arel.ast, Arel::Collectors::SQLString.new) do
+ visitor.compile(arel.ast) do
quote(*binds.shift.reverse)
end
- c.value
else
arel
end
diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb
index f1fc7b62e2..90bf751206 100644
--- a/activerecord/lib/active_record/relation.rb
+++ b/activerecord/lib/active_record/relation.rb
@@ -520,10 +520,9 @@ module ActiveRecord
arel = relation.arel
binds = arel.bind_values + relation.bind_values
- c = visitor.accept(arel.ast, Arel::Collectors::SQLString.new) do
+ visitor.compile(arel.ast) do
connection.quote(*binds.shift.reverse)
end
- c.value
end
end