1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove const_missing which fallback to deprecated NEVER_UNPERMITTED_PARAMS

`NEVER_UNPERMITTED_PARAMS` is deprecated in Rails 4.2. See #15933.
This commit is contained in:
Ryuta Kamizono 2016-02-08 05:43:57 +09:00
parent 3c96a6eaa4
commit 7433836f9a
2 changed files with 0 additions and 16 deletions

View file

@ -122,16 +122,6 @@ module ActionController
cattr_accessor :always_permitted_parameters
self.always_permitted_parameters = %w( controller action )
def self.const_missing(const_name)
return super unless const_name == :NEVER_UNPERMITTED_PARAMS
ActiveSupport::Deprecation.warn(<<-MSG.squish)
`ActionController::Parameters::NEVER_UNPERMITTED_PARAMS` has been deprecated.
Use `ActionController::Parameters.always_permitted_parameters` instead.
MSG
always_permitted_parameters
end
# Returns a new instance of <tt>ActionController::Parameters</tt>.
# Also, sets the +permitted+ attribute to the default value of
# <tt>ActionController::Parameters.permit_all_parameters</tt>.

View file

@ -12,12 +12,6 @@ class AlwaysPermittedParametersTest < ActiveSupport::TestCase
ActionController::Parameters.always_permitted_parameters = %w( controller action )
end
test "shows deprecations warning on NEVER_UNPERMITTED_PARAMS" do
assert_deprecated do
ActionController::Parameters::NEVER_UNPERMITTED_PARAMS
end
end
test "returns super on missing constant other than NEVER_UNPERMITTED_PARAMS" do
ActionController::Parameters.superclass.stub :const_missing, "super" do
assert_equal "super", ActionController::Parameters::NON_EXISTING_CONSTANT