Env getters
authorAidan Cornelius-Bell <aidan@cornelius-bell.com>
Sun, 15 Sep 2024 01:04:43 +0000 (10:34 +0930)
committerAidan Cornelius-Bell <aidan@cornelius-bell.com>
Sun, 15 Sep 2024 01:04:43 +0000 (10:34 +0930)
Gemfile
config/database.yml

diff --git a/Gemfile b/Gemfile
index 586b80006694c38800168ae6b7a022cb17c66d73..24385f855967e1d4d936cd15f35fa497136690a2 100644 (file)
--- 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
index 7bf42f8c4b5ed131dfb1e0797b79db0bb0711378..35187754f16fd049d7a46df372dd401ed6f00faa 100644 (file)
@@ -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") %>