mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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.
This commit is contained in:
parent
2095d364bc
commit
8fa2ecf8ed
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue