chore: Upgrade rails and ruby versions (#2400)

ruby version: 3.0.2
rails version: 6.1.4
This commit is contained in:
Sojan Jose
2021-08-03 20:11:52 +05:30
committed by GitHub
parent 7e960b7c72
commit ab54d9c629
61 changed files with 498 additions and 626 deletions

View File

@@ -1,28 +1,4 @@
Raven.configure do |config|
Sentry.init do |config|
config.dsn = ENV['SENTRY_DSN']
config.environments = %w[staging production]
config.enabled_environments = %w[staging production]
end
module QueryTrace
def self.enable!
::ActiveRecord::LogSubscriber.send(:include, self)
end
def self.append_features(klass)
super
klass.class_eval do
unless method_defined?(:log_info_without_trace)
alias_method :log_info_without_trace, :sql
alias_method :sql, :log_info_with_trace
end
end
end
def log_info_with_trace(event)
log_info_without_trace(event)
trace_log = Rails.backtrace_cleaner.clean(caller).first
logger.debug(" \\_ \e[33mCalled from:\e[0m #{trace_log}") if trace_log && event.payload[:name] != 'SCHEMA'
end
end
QueryTrace.enable! unless Rails.env.production?