edge badge
Methods
A
I
Constants
MASTER_KEY_PATH = Pathname.new("config/master.key")
 
Instance Public methods
add_master_key_file()
# File railties/lib/rails/generators/rails/master_key/master_key_generator.rb, line 12
def add_master_key_file
  unless MASTER_KEY_PATH.exist?
    key = ActiveSupport::EncryptedFile.generate_key

    log "Adding #{MASTER_KEY_PATH} to store the master 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_master_key_file_silently(key)
    log ""
  end
end
add_master_key_file_silently(key = nil)
# File railties/lib/rails/generators/rails/master_key/master_key_generator.rb, line 28
def add_master_key_file_silently(key = nil)
  key_file_generator.add_key_file_silently(MASTER_KEY_PATH, key)
end
ignore_master_key_file()
# File railties/lib/rails/generators/rails/master_key/master_key_generator.rb, line 32
def ignore_master_key_file
  key_file_generator.ignore_key_file(MASTER_KEY_PATH, ignore: key_ignore)
end
ignore_master_key_file_silently()
# File railties/lib/rails/generators/rails/master_key/master_key_generator.rb, line 36
def ignore_master_key_file_silently
  key_file_generator.ignore_key_file_silently(MASTER_KEY_PATH, ignore: key_ignore)
end