Sha256: 3f49c3c74a0a98905b112012efce33724a9407be5f59070bc783b515c6c875b6

Contents?: true

Size: 634 Bytes

Versions: 11

Compression:

Stored size: 634 Bytes

Contents

require "rails/engine"

module AhoyEmail
  class Engine < ::Rails::Engine
    initializer "ahoy_email" do |app|
      AhoyEmail.secret_token ||= begin
        creds =
          if app.respond_to?(:credentials) && app.credentials.secret_key_base
            app.credentials
          elsif app.respond_to?(:secrets)
            app.secrets
          else
            app.config
          end

        token = creds.respond_to?(:secret_key_base) ? creds.secret_key_base : creds.secret_token
        token ||= app.secret_key_base # should come first, but need to maintain backward compatibility
        token
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ahoy_email-2.2.0 lib/ahoy_email/engine.rb
ahoy_email-2.1.3 lib/ahoy_email/engine.rb
ahoy_email-2.1.2 lib/ahoy_email/engine.rb
ahoy_email-2.1.1 lib/ahoy_email/engine.rb
ahoy_email-2.1.0 lib/ahoy_email/engine.rb
ahoy_email-2.0.3 lib/ahoy_email/engine.rb
ahoy_email-2.0.2 lib/ahoy_email/engine.rb
ahoy_email-2.0.1 lib/ahoy_email/engine.rb
ahoy_email-2.0.0 lib/ahoy_email/engine.rb
ahoy_email-1.1.1 lib/ahoy_email/engine.rb
ahoy_email-1.1.0 lib/ahoy_email/engine.rb