activerecord-cause 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 54ca7b1399c8230ab12deef17b2639e5d6b0e06aa564bead2daeb246ee720880
|
4
|
+
data.tar.gz: 71cde8d2f692c8f27a82de10434bb05369eb09a6073ba1f330100f5467f57cae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7f68258e9ec31b850ba51b6975f61e28b8c5bab019219efc199e3cb55b05113ba253722f44c2d124df94471a15483e97de5a7118b395c881cf56a01ffdf0948
|
7
|
+
data.tar.gz: b7816dded9c23a9c1e4779333c90f57190b3824212ebd276cc43325520cb6e8db3a9232dddd3da92aa7da60a3ca193d48153b7c9a1ab7a174ba9ab192618b061
|
data/.travis.yml
CHANGED
data/lib/activerecord/cause.rb
CHANGED
@@ -147,13 +147,28 @@ module ActiveRecord
|
|
147
147
|
" " + payload[:binds].zip(casted_params).map { |attr, value| render_bind(attr, value) }.inspect
|
148
148
|
end
|
149
149
|
end
|
150
|
+
|
151
|
+
class LogSubscriberAR515 < LogSubscriberAR502
|
152
|
+
def sql(event)
|
153
|
+
super
|
154
|
+
end
|
155
|
+
|
156
|
+
private
|
157
|
+
|
158
|
+
def get_binds(payload)
|
159
|
+
casted_params = type_casted_binds(payload[:type_casted_binds])
|
160
|
+
" " + payload[:binds].zip(casted_params).map { |attr, value| render_bind(attr, value) }.inspect
|
161
|
+
end
|
162
|
+
end
|
150
163
|
end
|
151
164
|
end
|
152
165
|
|
153
166
|
require "activerecord/cause/railtie" if defined?(Rails)
|
154
167
|
|
155
168
|
ActiveSupport.on_load(:active_record) do
|
156
|
-
if ActiveRecord.version >= Gem::Version.new("5.
|
169
|
+
if ActiveRecord.version >= Gem::Version.new("5.1.5")
|
170
|
+
ActiveRecord::Cause::LogSubscriberAR515.attach_to :active_record
|
171
|
+
elsif ActiveRecord.version >= Gem::Version.new("5.0.3")
|
157
172
|
ActiveRecord::Cause::LogSubscriberAR503.attach_to :active_record
|
158
173
|
elsif ActiveRecord.version >= Gem::Version.new("5.0.0")
|
159
174
|
ActiveRecord::Cause::LogSubscriberAR502.attach_to :active_record
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-cause
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joker1007
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -99,7 +99,8 @@ files:
|
|
99
99
|
- gemfiles/activerecord-42.gemfile
|
100
100
|
- gemfiles/activerecord-502.gemfile
|
101
101
|
- gemfiles/activerecord-503.gemfile
|
102
|
-
- gemfiles/activerecord-
|
102
|
+
- gemfiles/activerecord-514.gemfile
|
103
|
+
- gemfiles/activerecord-515.gemfile
|
103
104
|
- lib/activerecord-cause.rb
|
104
105
|
- lib/activerecord/cause.rb
|
105
106
|
- lib/activerecord/cause/railtie.rb
|
@@ -123,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
124
|
version: '0'
|
124
125
|
requirements: []
|
125
126
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.6
|
127
|
+
rubygems_version: 2.7.6
|
127
128
|
signing_key:
|
128
129
|
specification_version: 4
|
129
130
|
summary: This gem logs where ActiveRecord actually loads record
|