diff --git a/config/application.rb b/config/application.rb index bfb2c61a..463f1bc5 100644 --- a/config/application.rb +++ b/config/application.rb @@ -27,7 +27,7 @@ class Application < Rails::Application end # Include from lib - config.eager_load_namespaces << Postal + config.eager_load_paths << Rails.root.join("lib") # Disable field_with_errors config.action_view.field_error_proc = proc { |t, i| t } diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index ee182ad4..fc1f8dc6 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -12,13 +12,17 @@ # These inflection rules are supported but not enabled by default: ActiveSupport::Inflector.inflections(:en) do |inflect| - inflect.acronym "API" + + inflect.acronym "DKIM" + inflect.acronym "HTTP" inflect.acronym "SMTP" - inflect.acronym "IP" - inflect.acronym "DNS" inflect.acronym "UUID" - inflect.acronym "HTTP" + + inflect.acronym "API" + inflect.acronym "DNS" + inflect.acronym "DB" + inflect.acronym "IP" + inflect.acronym "MQ" inflect.acronym "MX" - inflect.acronym "DKIM" end diff --git a/lib/postal.rb b/lib/postal.rb index 4b96e6e7..b6f261bc 100644 --- a/lib/postal.rb +++ b/lib/postal.rb @@ -1,45 +1,2 @@ module Postal - - extend ActiveSupport::Autoload - - eager_autoload do - autoload :AppLogger - autoload :BounceMessage - autoload :Config - autoload :Countries - autoload :DKIMHeader - autoload :Error - autoload :Helpers - autoload :HTTP - autoload :HTTPSender - autoload :Job - autoload :MessageDB - autoload :MessageInspection - autoload :MessageInspector - autoload :MessageInspectors - autoload :MessageParser - autoload :MessageRequeuer - autoload :MXLookup - autoload :QueryString - autoload :RabbitMQ - autoload :ReplySeparator - autoload :RspecHelpers - autoload :Sender - autoload :SendResult - autoload :SMTPSender - autoload :SMTPServer - autoload :SpamCheck - autoload :TrackingMiddleware - autoload :UserCreator - autoload :Version - autoload :Worker - end - - def self.eager_load! - super - Postal::MessageDB.eager_load! - Postal::SMTPServer.eager_load! - Postal::MessageInspectors.eager_load! - end - end diff --git a/lib/postal/message_db.rb b/lib/postal/message_db.rb index b187e43c..dcc50bc1 100644 --- a/lib/postal/message_db.rb +++ b/lib/postal/message_db.rb @@ -1,20 +1,4 @@ module Postal module MessageDB - - extend ActiveSupport::Autoload - eager_autoload do - autoload :Click - autoload :Database - autoload :Delivery - autoload :LiveStats - autoload :Load - autoload :Message - autoload :Migration - autoload :Provisioner - autoload :Statistics - autoload :SuppressionList - autoload :Webhooks - end - end end diff --git a/lib/postal/message_inspectors.rb b/lib/postal/message_inspectors.rb index 2be9941d..7c083f13 100644 --- a/lib/postal/message_inspectors.rb +++ b/lib/postal/message_inspectors.rb @@ -1,12 +1,4 @@ module Postal module MessageInspectors - - extend ActiveSupport::Autoload - eager_autoload do - autoload :Clamav - autoload :Rspamd - autoload :SpamAssassin - end - end end diff --git a/lib/postal/smtp_server.rb b/lib/postal/smtp_server.rb index b9a02d11..ff56918f 100644 --- a/lib/postal/smtp_server.rb +++ b/lib/postal/smtp_server.rb @@ -1,11 +1,4 @@ module Postal module SMTPServer - - extend ActiveSupport::Autoload - eager_autoload do - autoload :Client - autoload :Server - end - end end