aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/url_helper.rb
diff options
context:
space:
mode:
authorEdouard CHIN <edouard.chin@shopify.com>2017-04-23 22:20:55 -0400
committerEdouard CHIN <edouard.chin@shopify.com>2017-04-26 15:36:30 -0400
commit615fd399cd3c0e2f10874f21af89ac584dd0a0ba (patch)
tree6215b1e730d68b29a6e11474919fccb17833758d /actionview/lib/action_view/helpers/url_helper.rb
parent0dd40fe72cfcf53b475a4084d61e9e931417c29e (diff)
downloadrails-615fd399cd3c0e2f10874f21af89ac584dd0a0ba.tar.gz
rails-615fd399cd3c0e2f10874f21af89ac584dd0a0ba.tar.bz2
rails-615fd399cd3c0e2f10874f21af89ac584dd0a0ba.zip
Fix `current_page?` regression:
- `check_parameters` kwargs was added to the `current_page?` method, the implementation was assuming only hashes responds to `delete`. This was causing issues when `current_page?` was called with a Active Model object - ref https://github.com/rails/rails/pull/27549 - Fixes #28846
Diffstat (limited to 'actionview/lib/action_view/helpers/url_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/url_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/url_helper.rb b/actionview/lib/action_view/helpers/url_helper.rb
index 70fc57c35f..a6857101b9 100644
--- a/actionview/lib/action_view/helpers/url_helper.rb
+++ b/actionview/lib/action_view/helpers/url_helper.rb
@@ -542,7 +542,7 @@ module ActionView
return false unless request.get? || request.head?
- check_parameters ||= !options.is_a?(String) && options.try(:delete, :check_parameters)
+ check_parameters ||= options.is_a?(Hash) && options.delete(:check_parameters)
url_string = URI.parser.unescape(url_for(options)).force_encoding(Encoding::BINARY)
# We ignore any extra parameters in the request_uri if the