Skip to content

Commit

Permalink
Remove logger overrides
Browse files Browse the repository at this point in the history
These are no longer needed or used. The first shouldn't apply since by default we'll see the queries in the console after running an ActiveRecord query.
  • Loading branch information
javierjulio committed May 5, 2024
1 parent 19649d4 commit ccaed19
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions dotfiles/railsrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@

# http://rbjl.net/49-railsrc-rails-console-snippets

# Show queries after running AR methods in console.
ActiveRecord::Base.logger = Logger.new(STDOUT)

# View full debug query even if they fail with a StatementInvalid
# error. In the console, we would just see the error message with
# part of the query. By adding another logger to a file, there we
# will see the full debug query with all parameter values.
# Solution: https://stackoverflow.com/a/26704547
console_log = Rails.root.join('log', 'console.log')
if ::Rails::VERSION::STRING < "7.1"
ActiveRecord::Base.logger.extend(ActiveSupport::Logger.broadcast(Logger.new(console_log)))
end

def r
reload!
end
Expand Down

0 comments on commit ccaed19

Please sign in to comment.