Document ActiveSupport::EncryptedFile#key [ci-skip]

This commit is contained in:
Jonathan Hefner 2022-07-24 18:43:19 -05:00
parent bbcf4bd3c6
commit 3d0686a9f6
1 changed files with 4 additions and 0 deletions

View File

@ -45,6 +45,10 @@ module ActiveSupport
@env_key, @raise_if_missing_key = env_key, raise_if_missing_key
end
# Returns the encryption key, first trying the environment variable
# specified by +env_key+, then trying the key file specified by +key_path+.
# If +raise_if_missing_key+ is true, raises MissingKeyError if the
# environment variable is not set and the key file does not exist.
def key
read_env_key || read_key_file || handle_missing_key
end