method
generate_development_secret
v7.0.0 -
Show latest stable
- Class:
Rails::Application
generate_development_secret()private
No documentation available.
# File railties/lib/rails/application.rb, line 582
def generate_development_secret
if secrets.secret_key_base.nil?
key_file = Rails.root.join("tmp/development_secret.txt")
if !File.exist?(key_file)
random_key = SecureRandom.hex(64)
FileUtils.mkdir_p(key_file.dirname)
File.binwrite(key_file, random_key)
end
secrets.secret_key_base = File.binread(key_file)
end
secrets.secret_key_base
end