1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionmailbox/lib/action_mailbox/engine.rb

34 lines
1.2 KiB
Ruby
Raw Normal View History

# frozen_string_literal: true
require "rails"
require "action_controller/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "active_storage/engine"
2018-12-24 15:16:22 -05:00
require "action_mailbox"
module ActionMailbox
class Engine < Rails::Engine
isolate_namespace ActionMailbox
config.eager_load_namespaces << ActionMailbox
2018-10-01 08:16:10 -04:00
config.action_mailbox = ActiveSupport::OrderedOptions.new
config.action_mailbox.incinerate = true
2018-10-06 22:23:19 -04:00
config.action_mailbox.incinerate_after = 30.days
2018-10-01 08:16:10 -04:00
2018-11-11 18:23:13 -05:00
config.action_mailbox.queues = ActiveSupport::InheritableOptions.new \
incineration: :action_mailbox_incineration, routing: :action_mailbox_routing
initializer "action_mailbox.config" do
config.after_initialize do |app|
2018-10-01 08:16:10 -04:00
ActionMailbox.logger = app.config.action_mailbox.logger || Rails.logger
ActionMailbox.incinerate = app.config.action_mailbox.incinerate.nil? ? true : app.config.action_mailbox.incinerate
2018-10-06 22:23:19 -04:00
ActionMailbox.incinerate_after = app.config.action_mailbox.incinerate_after || 30.days
2018-11-11 18:23:13 -05:00
ActionMailbox.queues = app.config.action_mailbox.queues || {}
ActionMailbox.ingress = app.config.action_mailbox.ingress
end
end
end
end