File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,5 +34,13 @@ def config
3434 def configure
3535 yield ( config )
3636 end
37+
38+ def deprecator
39+ @deprecator ||= if defined? ( Rails )
40+ ActiveSupport ::Deprecation . new ( '1.0' , 'Ioki' )
41+ else
42+ Kernel
43+ end
44+ end
3745 end
3846end
Original file line number Diff line number Diff line change @@ -340,15 +340,7 @@ def attribute_deprecated?(attribute)
340340 end
341341
342342 def deprecation_warning ( message )
343- if defined? ( Rails )
344- deprecator . warn ( message )
345- else
346- warn message
347- end
348- end
349-
350- def deprecator
351- @deprecator ||= ActiveSupport ::Deprecation . new ( '1.0' , 'Ioki' )
343+ Ioki . deprecator . warn ( message )
352344 end
353345 end
354346 end
Original file line number Diff line number Diff line change @@ -8,5 +8,9 @@ class Railtie < ::Rails::Railtie
88 ActiveSupport . on_load ( :action_mailer ) do
99 add_delivery_method :ioki , Ioki ::Mailing ::Mailer
1010 end
11+
12+ initializer 'ioki.deprecator' do |app |
13+ app . deprecators [ :ioki ] = Ioki . deprecator
14+ end
1115 end
1216end
You can’t perform that action at this time.
0 commit comments