method
add_key_file
v5.2.3 -
Show latest stable
- Class:
Rails::Generators::EncryptionKeyFileGenerator
add_key_file(key_path)public
No documentation available.
# File railties/lib/rails/generators/rails/encryption_key_file/encryption_key_file_generator.rb, line 10
def add_key_file(key_path)
key_path = Pathname.new(key_path)
unless key_path.exist?
key = ActiveSupport::EncryptedFile.generate_key
log "Adding #{key_path} to store the encryption key: #{key}"
log ""
log "Save this in a password manager your team can access."
log ""
log "If you lose the key, no one, including you, can access anything encrypted with it."
log ""
add_key_file_silently(key_path, key)
log ""
end
end