Method: Rails::Application#credentials

Defined in:
railties/lib/rails/application.rb

#credentialsObject

Returns an ActiveSupport::EncryptedConfiguration instance for the credentials file specified by config.credentials.content_path.

By default, config.credentials.content_path will point to either config/credentials/#{environment}.yml.enc for the current environment (for example, config/credentials/production.yml.enc for the production environment), or config/credentials.yml.enc if that file does not exist.

The encryption key is taken from either ENV["RAILS_MASTER_KEY"], or from the file specified by config.credentials.key_path. By default, config.credentials.key_path will point to either config/credentials/#{environment}.key for the current environment, or config/master.key if that file does not exist.



495
496
497
# File 'railties/lib/rails/application.rb', line 495

def credentials
  @credentials ||= encrypted(config.credentials.content_path, key_path: config.credentials.key_path)
end