Skip to content

Commit 3ca36fb

Browse files
committed
Fix action_on_unpermitted_parameters setter
If the falue is false we should not try to calculate it.
1 parent bc00484 commit 3ca36fb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

actionpack/lib/action_controller/railtie.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,14 @@ class Railtie < Rails::Railtie # :nodoc:
3232
ActionController::Parameters.always_permitted_parameters =
3333
app.config.action_controller.always_permitted_parameters
3434
end
35-
ActionController::Parameters.action_on_unpermitted_parameters = options.action_on_unpermitted_parameters ||
36-
(Rails.env.test? || Rails.env.development?) ? :log : false
35+
36+
action_on_unpermitted_parameters = options.action_on_unpermitted_parameters
37+
38+
if action_on_unpermitted_parameters.nil?
39+
action_on_unpermitted_parameters = (Rails.env.test? || Rails.env.development?) ? :log : false
40+
end
41+
42+
ActionController::Parameters.action_on_unpermitted_parameters = action_on_unpermitted_parameters
3743
end
3844
end
3945

0 commit comments

Comments
 (0)