Sha256: 9ab317b4d1e04a16284590851a40393b1cc2a28d88e8a4740791e29fabe57980

Contents?: true

Size: 509 Bytes

Versions: 1

Compression:

Stored size: 509 Bytes

Contents

require "rails/engine"

module AhoyEmail
  class Engine < ::Rails::Engine
    initializer "ahoy_email" do |app|
      # default to secrets to keep backward compatible
      ActiveSupport::Deprecation.silence do
        secrets = app.respond_to?(:secrets) ? app.secrets : app.config
        AhoyEmail.secret_token ||= secrets.respond_to?(:secret_key_base) ? secrets.secret_key_base : secrets.secret_token
      end

      AhoyEmail.belongs_to = {optional: true} if Rails::VERSION::MAJOR >= 5
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ahoy_email-0.5.1 lib/ahoy_email/engine.rb