From 590c784a30b13153667f8db7915998d7731e24e5 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Mon, 17 Nov 2014 14:52:38 -0800 Subject: Add order to BindParams in the ToSql collector This removes the need for us to do the re-ordering by walking the AST in ActiveRecord. We're using a block to communicate with the collector, since the collector needs to be the thing which knows about the index, while the visitor is the thing that needs to know the syntax. The BindParam needs to know about neither of these things, so it's been changed to stop being a subclass of SqlLiteral I could also see an alternative implementation using format strings if for some reason blocks cause a problem. --- test/collectors/test_sql_string.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/collectors/test_sql_string.rb') diff --git a/test/collectors/test_sql_string.rb b/test/collectors/test_sql_string.rb index 6d2e23151b..cd121a1364 100644 --- a/test/collectors/test_sql_string.rb +++ b/test/collectors/test_sql_string.rb @@ -27,7 +27,7 @@ module Arel end def test_compile - bv = Nodes::BindParam.new('?') + bv = Nodes::BindParam.new collector = collect ast_with_binds bv sql = collector.compile ["hello", "world"] -- cgit v1.2.3