Class: Devise::SecretKeyFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/devise/secret_key_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(application) ⇒ SecretKeyFinder

Returns a new instance of SecretKeyFinder.



5
6
7
# File 'lib/devise/secret_key_finder.rb', line 5

def initialize(application)
  @application = application
end

Instance Method Details

#findObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/devise/secret_key_finder.rb', line 9

def find
  if @application.respond_to?(:credentials) && key_exists?(@application.credentials)
    @application.credentials.secret_key_base
  elsif @application.respond_to?(:secrets) && key_exists?(@application.secrets)
    @application.secrets.secret_key_base
  elsif @application.config.respond_to?(:secret_key_base) && key_exists?(@application.config)
    @application.config.secret_key_base
  elsif @application.respond_to?(:secret_key_base) && key_exists?(@application)
    @application.secret_key_base
  end
end