From 280e76e62d26a16d2e4a0ec46cec26c96d256ab5 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 1 May 2014 16:24:33 -0700 Subject: [PATCH] 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 --- actionpack/lib/action_dispatch/routing/polymorphic_routes.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb index 55f40fe204..dd2cbdcddc 100644 --- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +++ b/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) } -- GitLab