diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-03-22 11:19:13 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-03-22 11:19:13 -0700 |
commit | b45466757424b98e1fe9699042d23550fd5b8751 (patch) | |
tree | e1cc2a19420d89c70e8c1c09c2947b367efe45f2 | |
parent | 660768f57cc1fd6e66a1f675b774f782e431cf13 (diff) | |
parent | c50b40674664e0e5b971931536482ffbac47a1cf (diff) | |
download | rails-b45466757424b98e1fe9699042d23550fd5b8751.tar.gz rails-b45466757424b98e1fe9699042d23550fd5b8751.tar.bz2 rails-b45466757424b98e1fe9699042d23550fd5b8751.zip |
Merge pull request #112 from benedikt/master
Adds visit_Arel_Nodes_InfixOperation to Arel::Visitors::DepthFirst
-rw-r--r-- | lib/arel/visitors/depth_first.rb | 1 | ||||
-rw-r--r-- | test/visitors/test_depth_first.rb | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/arel/visitors/depth_first.rb b/lib/arel/visitors/depth_first.rb index 10bc24f36b..24c435ad1d 100644 --- a/lib/arel/visitors/depth_first.rb +++ b/lib/arel/visitors/depth_first.rb @@ -70,6 +70,7 @@ module Arel alias :visit_Arel_Nodes_GreaterThan :binary alias :visit_Arel_Nodes_GreaterThanOrEqual :binary alias :visit_Arel_Nodes_In :binary + alias :visit_Arel_Nodes_InfixOperation :binary alias :visit_Arel_Nodes_JoinSource :binary alias :visit_Arel_Nodes_InnerJoin :binary alias :visit_Arel_Nodes_LessThan :binary diff --git a/test/visitors/test_depth_first.rb b/test/visitors/test_depth_first.rb index 9c01fb8fcc..05360ff6e8 100644 --- a/test/visitors/test_depth_first.rb +++ b/test/visitors/test_depth_first.rb @@ -114,6 +114,12 @@ module Arel end end + def test_Arel_Nodes_InfixOperation + binary = Arel::Nodes::InfixOperation.new(:o, :a, :b) + @visitor.accept binary + assert_equal [:a, :b, binary], @collector.calls + end + # N-ary [ Arel::Nodes::And, |