aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-09-24 14:11:39 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-09-24 14:13:51 -0300
commit9357e5e383ec34182e2cbaf146d92efc2cc988ec (patch)
treeea745c231c3d8b657ed4098b4391b7b4b80bc957 /actionpack/lib
parent3f79a7716d195d8b3196b3d29e0e29ba539fe9d4 (diff)
downloadrails-9357e5e383ec34182e2cbaf146d92efc2cc988ec.tar.gz
rails-9357e5e383ec34182e2cbaf146d92efc2cc988ec.tar.bz2
rails-9357e5e383ec34182e2cbaf146d92efc2cc988ec.zip
Use join to concat the both side of the AST
Onf of the sides can be nil and it will raise a Conversion error
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/journey/visitors.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/journey/visitors.rb b/actionpack/lib/action_dispatch/journey/visitors.rb
index 1fea8344e7..fdcdda6977 100644
--- a/actionpack/lib/action_dispatch/journey/visitors.rb
+++ b/actionpack/lib/action_dispatch/journey/visitors.rb
@@ -110,10 +110,11 @@ module ActionDispatch
def visit_CAT(node, optional)
left = visit(node.left, optional)
right = visit(node.right, optional)
+
if optional && !(right && left)
""
else
- left + right
+ [left, right].join
end
end