aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2016-05-23 18:40:52 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2016-10-10 00:16:16 -0300
commit7093ceb480ad6a0a91b511832dad4c6a86981b93 (patch)
tree8d467bdb354f21ad03a1799279f6716bc5763d23
parentc396a8c991ba1143b33e844118765f7a1ca22666 (diff)
downloadrails-7093ceb480ad6a0a91b511832dad4c6a86981b93.tar.gz
rails-7093ceb480ad6a0a91b511832dad4c6a86981b93.tar.bz2
rails-7093ceb480ad6a0a91b511832dad4c6a86981b93.zip
Remove deprecated methods in ActionController::Parameters
-rw-r--r--actionpack/CHANGELOG.md4
-rw-r--r--actionpack/lib/action_controller/metal/strong_parameters.rb20
-rw-r--r--actionpack/test/controller/required_params_test.rb8
3 files changed, 5 insertions, 27 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md
index c23dbfbb42..aac2e270b4 100644
--- a/actionpack/CHANGELOG.md
+++ b/actionpack/CHANGELOG.md
@@ -1,3 +1,7 @@
+* Remove deprecated methods in `ActionController::Parameters`.
+
+ *Rafael Mendonça França*
+
* Remove deprecated support to comparing a `ActionController::Parameters`
with a `Hash`.
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb
index 9883f109f7..4db30e64b4 100644
--- a/actionpack/lib/action_controller/metal/strong_parameters.rb
+++ b/actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -611,28 +611,8 @@ 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
- Method #{method_sym} is deprecated and will be removed in Rails 5.1,
- as `ActionController::Parameters` no longer inherits from
- hash. Using this deprecated behavior exposes potential security
- problems. If you continue to use this method you may be creating
- a security vulnerability in your app that can be exploited. Instead,
- consider using one of these documented methods which are not
- deprecated: http://api.rubyonrails.org/v#{ActionPack.version}/classes/ActionController/Parameters.html
- DEPRECATE
- ActiveSupport::Deprecation.warn(message)
- @parameters.public_send(method_sym, *args, &block)
- else
- super
- end
- end
-
protected
attr_reader :parameters
diff --git a/actionpack/test/controller/required_params_test.rb b/actionpack/test/controller/required_params_test.rb
index 9fa2b6dbb0..dd07c2486b 100644
--- a/actionpack/test/controller/required_params_test.rb
+++ b/actionpack/test/controller/required_params_test.rb
@@ -72,14 +72,8 @@ class ParametersRequireTest < ActiveSupport::TestCase
assert params.value?("cinco")
end
- test "Deprecated methods are deprecated" do
- assert_deprecated do
- ActionController::Parameters.new(foo: "bar").merge!(bar: "foo")
- end
- end
-
test "to_query is not supported" do
- assert_deprecated do
+ assert_raises(NoMethodError) do
ActionController::Parameters.new(foo: "bar").to_param
end
end