dblint 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5882547f7ba7be4f29dfbd2e4fc685168e656036
4
- data.tar.gz: 1171ff0b3c9bdd3f8fb3d94d48fdff3ff041fb35
3
+ metadata.gz: 52f5eacd08e69f907b7bcac11162a2ef2d270321
4
+ data.tar.gz: 1de50cef76aceccdaf9a7f4b5bc32839b90e3d8a
5
5
  SHA512:
6
- metadata.gz: 72f796d6ddf84cf2ccb305e6e182b4172b0ced77455ed1377d563a65fe851ee731b6538386b3ad25b97b4e7467a45e993b321cc7bbf25bb36a31439ecabd8845
7
- data.tar.gz: 4734c644bb32a0f13a61cce0e2235351516ab241c3e403f65fe035f2e2f571c80b7da91a676281d317aca882948aa944dfa43a1fca74dbca29fe0c76a413e12b
6
+ metadata.gz: 2d61a6924fd91595b8f456332108c4ffdef1b20e4fb55b73ae79306f4fdff20db778cae8aab81d5bff7e8db394d50f393e30262aafe1628e7be371a5a5dcfeab
7
+ data.tar.gz: cd397ed2568760db4aafa1b66a2eb5f89d757691d0009147a272c74e511c0a9831b926a111cdc8bc30a599434a95b2d322ddae68cc0e4906f1faf110f04213b8
@@ -3,6 +3,7 @@ require: rubocop-rspec
3
3
  AllCops:
4
4
  Exclude:
5
5
  - spec/**/*
6
+ - vendor/**/*
6
7
 
7
8
  Documentation:
8
9
  Enabled: false
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0 2016-07-29
4
+
5
+ * Rails 5 support [#2](https://github.com/lfittl/dblint/pull/2) [@ksykulev](https://github.com/ksykulev)
6
+
7
+
3
8
  ## 0.1.1 2016-04-27
4
9
 
5
10
  * Fix handling of vendored gems [#1](https://github.com/lfittl/dblint/pull/1) [@ksykulev](https://github.com/ksykulev)
@@ -61,7 +61,7 @@ module Dblint
61
61
  @existing_ids = {}
62
62
 
63
63
  ActiveRecord::Base.connection.tables.each do |table|
64
- next if table == 'schema_migrations'
64
+ next if %w(schema_migrations ar_internal_metadata).include?(table)
65
65
  @existing_ids[table] = ActiveRecord::Base.connection.select_values("SELECT id FROM #{table}", 'DBLINT').map(&:to_i)
66
66
  end
67
67
  end
@@ -27,9 +27,18 @@ module Dblint
27
27
 
28
28
  CHECKS.each do |check_klass|
29
29
  check = check_instance_for_connection(payload[:connection_id], check_klass)
30
- check.statement_finished(name, id, payload)
30
+ check.statement_finished(name, id, payload_from_version(ActiveRecord::VERSION::MAJOR, payload))
31
31
  end
32
32
  end
33
+
34
+ private
35
+
36
+ def payload_from_version(version, payload)
37
+ return payload if version == 4
38
+
39
+ compatible_binds = payload[:binds].map { |bind| [bind, bind.value] }
40
+ payload.merge(binds: compatible_binds)
41
+ end
33
42
  end
34
43
 
35
44
  ActiveSupport::Notifications.subscribe('sql.active_record', RailsIntegration.new)
@@ -1,3 +1,3 @@
1
1
  module Dblint
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dblint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Fittl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-27 00:00:00.000000000 Z
11
+ date: 2016-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -179,6 +179,7 @@ files:
179
179
  - CHANGELOG.md
180
180
  - CODE_OF_CONDUCT.md
181
181
  - Gemfile
182
+ - Gemfile.lock
182
183
  - LICENSE.txt
183
184
  - README.md
184
185
  - Rakefile