From e88f3cf035c0c44ee961d7a3d36fb9036290b2a3 Mon Sep 17 00:00:00 2001 From: Aidan Cornelius-Bell Date: Sun, 15 Sep 2024 10:34:43 +0930 Subject: [PATCH] Env getters --- Gemfile | 5 ++--- config/database.yml | 6 ++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 586b800..24385f8 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,8 @@ gem "redcarpet" gem "rouge" #html crawling gem "httparty" - +#environment stuff +gem "dotenv" # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis] # gem "kredis" @@ -41,8 +42,6 @@ group :development, :test do # Static analysis for security vulnerabilities [https://brakemanscanner.org/] gem "brakeman", require: false - gem "dotenv" - # Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/] gem "rubocop-rails-omakase", require: false end diff --git a/config/database.yml b/config/database.yml index 7bf42f8..3518775 100644 --- a/config/database.yml +++ b/config/database.yml @@ -51,5 +51,7 @@ test: production: <<: *default database: arelpe_production - username: arelpe - password: <%= ENV["ARELPE_DATABASE_PASSWORD"] %> + password: <%= ENV.fetch("MYSQL_PASSWORD") %> + host: <%= ENV.fetch("MYSQL_HOST") % + username: <%= ENV.fetch("MYSQL_USERNAME") %> + password: <%= ENV.fetch("MYSQL_PASSWORD") %> -- 2.39.5