Skip to content
This repository was archived by the owner on Jan 30, 2024. It is now read-only.

Commit 855ac1e

Browse files
Fix Rails 5 deprecation warning for to_prepare
1 parent acb1e1a commit 855ac1e

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

lib/devise_security_extension/rails.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ class Engine < ::Rails::Engine
33
ActiveSupport.on_load(:action_controller) do
44
include DeviseSecurityExtension::Controllers::Helpers
55
end
6-
7-
ActionDispatch::Callbacks.to_prepare do
8-
DeviseSecurityExtension::Patches.apply
9-
end
106

7+
if defined?(ActiveSupport::Reloader)
8+
ActiveSupport::Callbacks.to_prepare do
9+
DeviseSecurityExtension::Patches.apply
10+
end
11+
else
12+
ActionDispatch::Callbacks.to_prepare do
13+
DeviseSecurityExtension::Patches.apply
14+
end
15+
end
1116
end
1217
end

0 commit comments

Comments
 (0)