mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Rails::Application#secrets should be documented.
This commit is contained in:
parent
a407bb245b
commit
2f7b72b793
1 changed files with 15 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue