提交 8fa2ecf8 编写于 作者: K Kasper Timm Hansen

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.
上级 2095d364
......@@ -411,8 +411,6 @@ def [](key)
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 @@ def init_with(coder) # :nodoc:
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册