aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-08-31 21:36:37 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2016-08-31 21:36:37 +0200
commit8fa2ecf8ed9db0ce72defdba2c49ba61e701e27d (patch)
tree75eeb524bef87118d16eb592524af39c0a1a8b39 /actionpack/lib/action_controller/metal
parent2095d364bcbdce9dff885b1b832908212819dc3d (diff)
downloadrails-8fa2ecf8ed9db0ce72defdba2c49ba61e701e27d.tar.gz
rails-8fa2ecf8ed9db0ce72defdba2c49ba61e701e27d.tar.bz2
rails-8fa2ecf8ed9db0ce72defdba2c49ba61e701e27d.zip
Move to_param undef closer to the deprecations.
Makes it clearer why we're doing this Add a comment to elaborate on what the undef means and move it closer to the deprecations so it's less likely for whoever pulls the deprecations that it should go too.
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-rw-r--r--actionpack/lib/action_controller/metal/strong_parameters.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb
index f315d93939..dea4657988 100644
--- a/actionpack/lib/action_controller/metal/strong_parameters.rb
+++ b/actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -411,8 +411,6 @@ module ActionController
convert_hashes_to_parameters(key, @parameters[key])
end
- undef_method :to_param
-
# Assigns a value to a given +key+. The given key may still get filtered out
# when +permit+ is called.
def []=(key, value)
@@ -622,6 +620,10 @@ module ActionController
end
end
+ # Undefine `to_param` such that it gets caught in the `method_missing`
+ # deprecation cycle below.
+ undef_method :to_param
+
def method_missing(method_sym, *args, &block)
if @parameters.respond_to?(method_sym)
message = <<-DEPRECATE.squish