diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-12-23 09:44:04 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-12-23 09:44:12 -0700 |
commit | a0e34619b8b3b3aafa68151fd99b218f069ee7a8 (patch) | |
tree | 476704ebaa4a763c12557c012e08a806e1569289 /railties/lib/rails | |
parent | e35221cfd948098c6fabdff5fed3877edb8921d3 (diff) | |
parent | 2f7b72b793dc18449c4033932ebd9e667e55dd89 (diff) | |
download | rails-a0e34619b8b3b3aafa68151fd99b218f069ee7a8.tar.gz rails-a0e34619b8b3b3aafa68151fd99b218f069ee7a8.tar.bz2 rails-a0e34619b8b3b3aafa68151fd99b218f069ee7a8.zip |
Merge pull request #18170 from tgxworld/add_docs_for_rails_application_secrets
[ci skip]
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/application.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index f8bd6096f2..ad8b52a39f 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -368,7 +368,21 @@ module Rails @config = configuration end - def secrets #:nodoc: + # Returns secrets added to config/secrets.yml. + # + # Example: + # + # development: + # secret_key_base: 836fa3665997a860728bcb9e9a1e704d427cfc920e79d847d79c8a9a907b9e965defa4154b2b86bdec6930adbe33f21364523a6f6ce363865724549fdfc08553 + # test: + # secret_key_base: 5a37811464e7d378488b0f073e2193b093682e4e21f5d6f3ae0a4e1781e61a351fdc878a843424e81c73fb484a40d23f92c8dafac4870e74ede6e5e174423010 + # production: + # secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> + # namespace: my_app_production + # + # +Rails.application.secrets.namespace+ returns +my_app_production+ in the + # production environment. + def secrets @secrets ||= begin secrets = ActiveSupport::OrderedOptions.new yaml = config.paths["config/secrets"].first |