Method: Rails::Application#credentials
- Defined in:
- railties/lib/rails/application.rb
#credentials ⇒ Object
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.
Is best used via #creds to ensure that values can be overwritten via ENV (or .env in dev).
606 607 608 |
# File 'railties/lib/rails/application.rb', line 606 def credentials @credentials ||= encrypted(config.credentials.content_path, key_path: config.credentials.key_path) end |