38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/marginalia/railtie.rb', line 38
def self.insert_into_active_record
if defined? ActiveRecord::ConnectionAdapters::Mysql2Adapter
if ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::Mysql2Adapter)
ActiveRecord::ConnectionAdapters::Mysql2Adapter.module_eval do
include Marginalia::ActiveRecordInstrumentation
end
end
end
if defined? ActiveRecord::ConnectionAdapters::MysqlAdapter
if ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::MysqlAdapter)
ActiveRecord::ConnectionAdapters::MysqlAdapter.module_eval do
include Marginalia::ActiveRecordInstrumentation
end
end
end
if defined? ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
if ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.module_eval do
include Marginalia::ActiveRecordInstrumentation
end
end
end
if defined? ActiveRecord::ConnectionAdapters::SQLite3Adapter
if ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::SQLite3Adapter)
ActiveRecord::ConnectionAdapters::SQLite3Adapter.module_eval do
include Marginalia::ActiveRecordInstrumentation
end
end
end
end
|