Sha256: 02323192c0593fe8a11431813b250ca1b2b9504986f8c1f2346c343091a2878b

Contents?: true

Size: 509 Bytes

Versions: 4

Compression:

Stored size: 509 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

        creds.respond_to?(:secret_key_base) ? creds.secret_key_base : creds.secret_token
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ahoy_email-1.0.3 lib/ahoy_email/engine.rb
ahoy_email-1.0.2 lib/ahoy_email/engine.rb
ahoy_email-1.0.1 lib/ahoy_email/engine.rb
ahoy_email-1.0.0 lib/ahoy_email/engine.rb