Skip to content

Commit

Permalink
refactor: load crendentials before env
Browse files Browse the repository at this point in the history
  • Loading branch information
noxasch committed May 16, 2024
1 parent 40dcc07 commit de1bb93
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ def self.load_files(*sources)
config.add_source!(source)
end

config.add_source!(Sources::EnvSource.new(ENV)) if Config.use_env

# load rails crendentials
if defined?(::Rails::Railtie) && Config.use_rails_credentials
if Rails.application.credentials.respond_to?(:credentials)
config.add_source!(Sources::HashSource.new(Rails.application.credentials.config.deep_stringify_keys))
Expand All @@ -58,6 +57,8 @@ def self.load_files(*sources)
end
end

config.add_source!(Sources::EnvSource.new(ENV)) if Config.use_env

config.load!
config
end
Expand Down

0 comments on commit de1bb93

Please sign in to comment.