Sha256: ece69a6e41735fd4aefb17de6d0ad703b35e3d706630e0242babf04c5f35d270

Contents?: true

Size: 807 Bytes

Versions: 1

Compression:

Stored size: 807 Bytes

Contents

module Pay
  module Lago
    class Engine < ::Rails::Engine
      engine_name "pay_lago"

      initializer "pay_lago.processors", after: "pay.processors" do |app|
        ActiveSupport.on_load(:active_record) do
          include Pay::Lago::Attributes
        end
      end

      config.before_initialize do
        Pay::Lago.configure_webhooks if Pay::Lago.enabled?
      end

      config.to_prepare do
        # Include Concerns
        Pay::Customer.include Pay::Lago::PayCustomerExtensions
        Pay::Charge.include Pay::Lago::PayExtensions
        Pay::Subscription.include Pay::Lago::PayExtensions
        Pay::PaymentMethod.include Pay::Lago::PayPaymentMethodExtensions

        # Prepend Pay::Lago extensions
        Pay::Webhook.prepend Pay::Lago::WebhookExtensions
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pay-lago-0.1.1 lib/pay/lago/engine.rb