diff options
| author | realtradam <[email protected]> | 2024-06-17 22:33:24 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2024-06-17 22:33:24 -0400 |
| commit | 5fb193314230fd69a15b255aa713fef22f0b313b (patch) | |
| tree | 4d6948682df4f48a06e02f65b7035a839b5c1ed3 /config/application.rb | |
| parent | 39f2dc47ef9aa94b2fe30019715a9484000552a9 (diff) | |
| download | gameHolster-5fb193314230fd69a15b255aa713fef22f0b313b.tar.gz gameHolster-5fb193314230fd69a15b255aa713fef22f0b313b.zip | |
change login to use new tab
Diffstat (limited to 'config/application.rb')
| -rw-r--r-- | config/application.rb | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/config/application.rb b/config/application.rb index 313b2a2..434df8d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,6 +1,7 @@ require_relative "boot" require "rails/all" +require 'tomlib' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. @@ -33,15 +34,33 @@ module GamesHost config.middleware.use ActionDispatch::Session::CookieStore config.active_storage.content_types_allowed_inline << "text/html" - + #localhost:5173 #config.session_store :cookie_store, key: 'session', domain: :all, tld_length: 5 + #config.before_configuration do + # env_file = File.join(Rails.root, 'config', 'local_env.yml') + # if File.exist?(env_file) + # YAML.load(File.open(env_file)).each do |key, value| + # ENV[key.to_s] = value + # end + # end + #end config.before_configuration do - env_file = File.join(Rails.root, 'config', 'local_env.yml') + env_file = File.join(Rails.root, 'config', 'env.toml') if File.exist?(env_file) - YAML.load(File.open(env_file)).each do |key, value| - ENV[key.to_s] = value + env = Tomlib.load(File.read(env_file)) + env['default'].each do |key, value| + ENV[key] = value + end + if Rails.env.production? + env['production'].each do |key, value| + ENV[key] = value + end + elsif Rails.env.development? + env['development'].each do |key, value| + ENV[key] = value + end end end end |
