Sha256: b46220c08d5b6530cd1a06cc4c553e7c574bb60482250be349aa7e0d0a384314

Contents?: true

Size: 1.2 KB

Versions: 11

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

require "rails/railtie"

module AcidicJob
  class Rails < ::Rails::Railtie
    initializer "acidic_job.action_mailer_extension" do
      ::ActiveSupport.on_load(:action_mailer) do
        # Add `deliver_acidicly` to ActionMailer
        ::ActionMailer::Parameterized::MessageDelivery.include(Extensions::ActionMailer)
        ::ActionMailer::MessageDelivery.include(Extensions::ActionMailer)
      end
    end

    initializer "acidic_job.active_job_serializers" do
      ::ActiveSupport.on_load(:active_job) do
        ::ActiveJob::Serializers.add_serializers(
          Serializers::ExceptionSerializer,
          Serializers::FinishedPointSerializer,
          Serializers::JobSerializer,
          Serializers::RangeSerializer,
          Serializers::RecoveryPointSerializer,
          Serializers::WorkerSerializer
        )
      end
    end

    generators do
      require "generators/acidic_job/install_generator"
    end

    # This hook happens after all initializers are run, just before returning
    config.after_initialize do
      if defined?(::Noticed)
        # Add `deliver_acidicly` to Noticed
        ::Noticed::Base.include(Extensions::Noticed)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
acidic_job-0.8.3 lib/acidic_job/rails.rb
acidic_job-0.8.2 lib/acidic_job/rails.rb
acidic_job-0.8.1 lib/acidic_job/rails.rb
acidic_job-0.8.0 lib/acidic_job/rails.rb
acidic_job-1.0.0.beta.10 lib/acidic_job/rails.rb
acidic_job-1.0.0.beta.9 lib/acidic_job/rails.rb
acidic_job-1.0.0.beta.8 lib/acidic_job/rails.rb
acidic_job-1.0.0.beta.7 lib/acidic_job/rails.rb
acidic_job-1.0.0.beta.6 lib/acidic_job/rails.rb
acidic_job-1.0.0.beta.5 lib/acidic_job/rails.rb
acidic_job-1.0.0.beta.4 lib/acidic_job/rails.rb