Skip to content

Commit

Permalink
Set up AR logger only if it makes sense
Browse files Browse the repository at this point in the history
  • Loading branch information
rsamoilov committed Sep 16, 2024
1 parent f6ff771 commit 98eb072
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/rage/ext/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,8 @@ def connection_cache_key(_)
ActiveRecord::Base.configurations = database_file_config || { Rage.env.to_s => database_url_config }
ActiveRecord::Base.establish_connection(Rage.env.to_sym)

if defined?(Rake)
ActiveRecord::Base.logger = nil
else
ActiveRecord::Base.logger = Rage.logger
unless defined?(Rake)
ActiveRecord::Base.logger = Rage.logger if Rage.logger.debug?
ActiveRecord::Base.connection_pool.with_connection {} # validate the connection
end
end
Expand Down

0 comments on commit 98eb072

Please sign in to comment.