Skip to content

Commit 9de32e0

Browse files
authored
Use a when clause for the Class check
1 parent 20ced47 commit 9de32e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

actionpack/lib/action_controller/metal/request_forgery_protection.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,15 @@ def skip_forgery_protection(options = {})
164164

165165
private
166166
def protection_method_class(name)
167-
return name if name.is_a?(Class)
168-
169167
case name
170168
when :null_session
171169
ProtectionMethods::NullSession
172170
when :reset_session
173171
ProtectionMethods::ResetSession
174172
when :exception
175173
ProtectionMethods::Exception
174+
when Class
175+
name
176176
else
177177
raise ArgumentError, "Invalid request forgery protection method, use :null_session, :exception, :reset_session, or a custom forgery protection class."
178178
end

0 commit comments

Comments
 (0)