aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikac.hu>2015-07-13 16:43:21 -0400
committerPrem Sichanugrist <s@sikac.hu>2015-07-15 11:11:36 -0400
commit14a3bd520dd4bbf1247fd3e0071b59c02c115ce0 (patch)
tree23d5f059a39e699aa0762fcea54fd33cd7952bdd /actionview
parenta0b4dc21a2188a4379bc401b73336608fec56c64 (diff)
downloadrails-14a3bd520dd4bbf1247fd3e0071b59c02c115ce0.tar.gz
rails-14a3bd520dd4bbf1247fd3e0071b59c02c115ce0.tar.bz2
rails-14a3bd520dd4bbf1247fd3e0071b59c02c115ce0.zip
Make AC::Parameters not inherited from Hash
This is another take at #14384 as we decided to wait until `master` is targeting Rails 5.0. This commit is implementation-complete, as it guarantees that all the public methods on the hash-inherited Parameters are still working (based on test case). We can decide to follow-up later if we want to remove some methods out from Parameters.
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/routing_url_for.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionview/lib/action_view/routing_url_for.rb b/actionview/lib/action_view/routing_url_for.rb
index 0371db07dc..20d6b9a64c 100644
--- a/actionview/lib/action_view/routing_url_for.rb
+++ b/actionview/lib/action_view/routing_url_for.rb
@@ -92,6 +92,16 @@ module ActionView
end
super(options)
+ when ActionController::Parameters
+ unless options.key?(:only_path)
+ if options[:host].nil?
+ options[:only_path] = _generate_paths_by_default
+ else
+ options[:only_path] = false
+ end
+ end
+
+ super(options)
when :back
_back_url
when Array