mirror of https://github.com/rails/rails
Add ActionMailbox.deprecator
This commit adds `ActionMailbox.deprecator`, and adds it to `Rails.application.deprecators` so that it can be configured via settings such as `config.active_support.report_deprecations`.
This commit is contained in:
parent
5a4eadd51c
commit
f434310b3b
|
@ -1,5 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "action_mailbox/deprecator"
|
||||
require "action_mailbox/mail_ext"
|
||||
|
||||
module ActionMailbox
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ActionMailbox
|
||||
def self.deprecator # :nodoc:
|
||||
@deprecator ||= ActiveSupport::Deprecation.new
|
||||
end
|
||||
end
|
|
@ -22,6 +22,10 @@ module ActionMailbox
|
|||
|
||||
config.action_mailbox.storage_service = nil
|
||||
|
||||
initializer "action_mailbox.deprecator" do |app|
|
||||
app.deprecators[:action_mailbox] = ActionMailbox.deprecator
|
||||
end
|
||||
|
||||
initializer "action_mailbox.config" do
|
||||
config.after_initialize do |app|
|
||||
ActionMailbox.logger = app.config.action_mailbox.logger || Rails.logger
|
||||
|
|
|
@ -3893,6 +3893,7 @@ module ApplicationTests
|
|||
assert_equal AbstractController.deprecator, Rails.application.deprecators[:action_controller]
|
||||
assert_equal ActionController.deprecator, Rails.application.deprecators[:action_controller]
|
||||
assert_equal ActionDispatch.deprecator, Rails.application.deprecators[:action_dispatch]
|
||||
assert_equal ActionMailbox.deprecator, Rails.application.deprecators[:action_mailbox]
|
||||
assert_equal ActionMailer.deprecator, Rails.application.deprecators[:action_mailer]
|
||||
assert_equal ActionView.deprecator, Rails.application.deprecators[:action_view]
|
||||
assert_equal ActiveJob.deprecator, Rails.application.deprecators[:active_job]
|
||||
|
|
Loading…
Reference in New Issue