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
- SHA1:
3
- metadata.gz: 3633af93848d0ee412d2e055aba320859a69bfbd
4
- data.tar.gz: 90d3a3d9c599e197acfaac3f049030cb1adb5012
2
+ SHA256:
3
+ metadata.gz: 54ca7b1399c8230ab12deef17b2639e5d6b0e06aa564bead2daeb246ee720880
4
+ data.tar.gz: 71cde8d2f692c8f27a82de10434bb05369eb09a6073ba1f330100f5467f57cae
5
5
  SHA512:
6
- metadata.gz: 9bcd4c7215f7bcb314e300f5474b94e04526f6ab5e5bf96b7fbde6bd785ee3d04fb1aa49c4546f885788aae29d82dace79c2412447adb1d9e00da4318e547d4c
7
- data.tar.gz: 2618b0b4f6a67128620083b57180b4f784fe0a04c4f73a8c92306b84db37c34194b62786b6c3def4583cadfc61427ec7cbb6f697ca138f12e2ccf4fbd0421dc7
6
+ metadata.gz: d7f68258e9ec31b850ba51b6975f61e28b8c5bab019219efc199e3cb55b05113ba253722f44c2d124df94471a15483e97de5a7118b395c881cf56a01ffdf0948
7
+ data.tar.gz: b7816dded9c23a9c1e4779333c90f57190b3824212ebd276cc43325520cb6e8db3a9232dddd3da92aa7da60a3ca193d48153b7c9a1ab7a174ba9ab192618b061
@@ -7,4 +7,5 @@ gemfile:
7
7
  - gemfiles/activerecord-42.gemfile
8
8
  - gemfiles/activerecord-502.gemfile
9
9
  - gemfiles/activerecord-503.gemfile
10
- - gemfiles/activerecord-51.gemfile
10
+ - gemfiles/activerecord-514.gemfile
11
+ - gemfiles/activerecord-515.gemfile
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "activerecord", "~> 5.1.0", "< 5.1.5"
4
+
5
+ gemspec :path => "../"
@@ -1,5 +1,5 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem "activerecord", "~> 5.1.0"
3
+ gem "activerecord", "~> 5.1.5"
4
4
 
5
5
  gemspec :path => "../"
@@ -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.0.3")
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
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Cause
3
- VERSION = "0.5.1"
3
+ VERSION = "0.6.0"
4
4
  end
5
5
  end
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.5.1
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: 2017-05-23 00:00:00.000000000 Z
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-51.gemfile
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.11
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