File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ module WebConsole
28
28
def self . logger
29
29
( defined? ( Rails . logger ) && Rails . logger ) || ( @logger ||= ActiveSupport ::Logger . new ( $stderr) )
30
30
end
31
+
32
+ def self . deprecator
33
+ @deprecator ||= ActiveSupport ::Deprecation . new ( "5.0" , "WebConsole" )
34
+ end
31
35
end
32
36
33
37
require "web_console/railtie"
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ class Railtie < ::Rails::Railtie
52
52
end
53
53
54
54
initializer "web_console.deprecator" do |app |
55
- app . deprecators [ :web_console ] = ActiveSupport :: Deprecation . new ( "5.0" , "WebConsole" )
55
+ app . deprecators [ :web_console ] = WebConsole . deprecator if app . respond_to? ( :deprecators )
56
56
end
57
57
58
58
initializer "web_console.permissions" do
@@ -67,7 +67,7 @@ def web_console_permissions
67
67
when config . web_console . allowed_ips
68
68
config . web_console . allowed_ips
69
69
when config . web_console . whitelisted_ips
70
- Rails . application . deprecators [ :web_console ] . warn ( <<-MSG . squish )
70
+ WebConsole . deprecator . warn ( <<-MSG . squish )
71
71
The config.web_console.whitelisted_ips is deprecated and will be ignored in future release of web_console.
72
72
Please use config.web_console.allowed_ips instead.
73
73
MSG
You can’t perform that action at this time.
0 commit comments