Permalink
Browse files

only add the optiosn if they are not empty

I think this is wrong, but it gets the build passing for now. We should
always add options, but we need to make more guarantees about how the
underlying url helper is called
  • Loading branch information...
1 parent b44bfa4 commit 280e76e62d26a16d2e4a0ec46cec26c96d256ab5 @tenderlove tenderlove committed May 1, 2014
Showing with 3 additions and 1 deletion.
  1. +3 −1 actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
View
4 actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
@@ -135,7 +135,9 @@ def polymorphic_url(record_or_hash_or_array, options = {})
named_route = build_named_route_call(record_or_hash_or_array, record, inflection, options)
url_options = options.except(:action, :routing_type)
- args << url_options
+ unless url_options.empty?
+ args << url_options
+ end
args.collect! { |a| convert_to_model(a) }

0 comments on commit 280e76e

Please sign in to comment.