diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-08-31 21:36:37 +0200 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2016-08-31 21:36:37 +0200 |
commit | 8fa2ecf8ed9db0ce72defdba2c49ba61e701e27d (patch) | |
tree | 75eeb524bef87118d16eb592524af39c0a1a8b39 /actionpack/lib | |
parent | 2095d364bcbdce9dff885b1b832908212819dc3d (diff) | |
download | rails-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')
-rw-r--r-- | actionpack/lib/action_controller/metal/strong_parameters.rb | 6 |
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 |