diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/nodes/string_join.rb | 3 | ||||
-rw-r--r-- | lib/arel/visitors/depth_first.rb | 5 | ||||
-rw-r--r-- | lib/arel/visitors/join_sql.rb | 7 |
3 files changed, 7 insertions, 8 deletions
diff --git a/lib/arel/nodes/string_join.rb b/lib/arel/nodes/string_join.rb index b5420e2dfc..7fb0033c0f 100644 --- a/lib/arel/nodes/string_join.rb +++ b/lib/arel/nodes/string_join.rb @@ -1,6 +1,9 @@ module Arel module Nodes class StringJoin < Arel::Nodes::Join + def initialize left, right = nil + super + end end end end diff --git a/lib/arel/visitors/depth_first.rb b/lib/arel/visitors/depth_first.rb index 5ebd1296dd..eec356af4c 100644 --- a/lib/arel/visitors/depth_first.rb +++ b/lib/arel/visitors/depth_first.rb @@ -67,10 +67,13 @@ module Arel alias :visit_Arel_Nodes_Or :binary alias :visit_Arel_Nodes_Ordering :binary alias :visit_Arel_Nodes_OuterJoin :binary - alias :visit_Arel_Nodes_StringJoin :binary alias :visit_Arel_Nodes_TableAlias :binary alias :visit_Arel_Nodes_Values :binary + def visit_Arel_Nodes_StringJoin o + visit o.left + end + def visit_Arel_Attribute o visit o.relation visit o.name diff --git a/lib/arel/visitors/join_sql.rb b/lib/arel/visitors/join_sql.rb index 8c31934cd0..1cdd7eb5ca 100644 --- a/lib/arel/visitors/join_sql.rb +++ b/lib/arel/visitors/join_sql.rb @@ -14,13 +14,6 @@ module Arel def visit_Arel_Nodes_SelectCore o o.source.right.map { |j| visit j }.join ' ' end - - def visit_Arel_Nodes_StringJoin o - [ - (visit o.left if Nodes::Join === o.left), - visit(o.right) - ].compact.join ' ' - end end end end |