17 lines
369 B
Ruby
17 lines
369 B
Ruby
# typed: true
|
|
module DebugHelpers
|
|
# add `log_sql: true` to tags
|
|
def self.log_sql
|
|
logger = ActiveRecord::Base.logger
|
|
ActiveRecord::Base.logger = Logger.new($stdout)
|
|
yield
|
|
ensure
|
|
ActiveRecord::Base.logger = logger
|
|
end
|
|
|
|
# add `quiet: false` to show ColorLogger output
|
|
def self.quiet_color_logger(&block)
|
|
ColorLogger.quiet(&block)
|
|
end
|
|
end
|