dbee-active_record 1.0.1 → 1.0.2

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
2
  SHA256:
3
- metadata.gz: 13a6e859cfda81bef925efcdf8b7686df6aab8c50dc614b869face063445ccb0
4
- data.tar.gz: 5702022d37244525b7c88ea87ffba3c9836209d3fafbb42a27f09dc8ee167ec8
3
+ metadata.gz: ec33481a6a1eb0dd9ddb60ace985456f5e8d085559d8923607bb252c013498de
4
+ data.tar.gz: 49fe65ebf0caeb1f0e87482309352ed0e258cfd57c2ab26e2c3867d2c7e4a27a
5
5
  SHA512:
6
- metadata.gz: 22f8257ae899206e51bcbcc702e22913d0e174d6b4baaf906b12ed498a8c2e1c8d3cd8294b64df8a1b53570d666910afe0e8263ef06d57df4c5ff4e6327ea085
7
- data.tar.gz: fc2ac48d0710372a7bce9b9113a43638a2c66245c645a577a7c01e86ec23d6a76972e4ee28a9fa4cfb88d197dec0b7e162fbb72cf641f483864b3f19d687b2af
6
+ metadata.gz: 44d6130ac9b617fddc0943caeabc65576e5617eac9bad7367757ab8ddff1dc98e3e542b9ec564da20f4d1c3c3e1094b8c4e8e27156e76ddea248d12afb38e570
7
+ data.tar.gz: 7288cd2c2cbb0ee5e57278aa0d5ec308dc0c3dfeb8fe032cb5a50c5e9c42f2110388fd3933d2a46199fea901fda10509359c422e19d9be9d55e9228e449a292a
data/.rubocop.yml CHANGED
@@ -9,6 +9,9 @@ Metrics/BlockLength:
9
9
  - context
10
10
  - specify
11
11
  - define
12
+ Exclude:
13
+ - spec/dbee/**/*
14
+ - dbee-active_record.gemspec
12
15
 
13
16
  Metrics/MethodLength:
14
17
  Max: 25
data/.travis.yml CHANGED
@@ -9,6 +9,13 @@ rvm:
9
9
  - 2.4.6
10
10
  - 2.5.5
11
11
  - 2.6.3
12
+ env:
13
+ - AR_VERSION=5
14
+ - AR_VERSION=6
15
+ matrix:
16
+ exclude:
17
+ - rvm: 2.4.6
18
+ env: AR_VERSION=6
12
19
  cache: bundler
13
20
  before_script:
14
21
  - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 1.0.2 (August 26th, 2019)
2
+
3
+ * Only support Dbee version 1.0.2 and above
4
+ * Added support and test matrices for ActiveRecord 6
5
+
1
6
  # 1.0.1 (August 26th, 2019)
2
7
 
3
8
  * Only support Dbee version 1.0.1 and above
@@ -21,8 +21,20 @@ Gem::Specification.new do |s|
21
21
 
22
22
  s.required_ruby_version = '>= 2.4.6'
23
23
 
24
- s.add_dependency('activerecord', '~>5', '>=5.2.1')
25
- s.add_dependency('dbee', '~>1', '>=1.0.1')
24
+ ar_version = ENV['AR_VERSION'] || ''
25
+
26
+ activerecord_version =
27
+ case ar_version
28
+ when '6'
29
+ ['>=6.0.0', '<7']
30
+ when '5'
31
+ ['>=5.2.1', '<6']
32
+ else
33
+ ['>=5.2.1', '<7']
34
+ end
35
+
36
+ s.add_dependency('activerecord', activerecord_version)
37
+ s.add_dependency('dbee', '~>1', '>=1.0.2')
26
38
 
27
39
  s.add_development_dependency('guard-rspec', '~>4.7')
28
40
  s.add_development_dependency('mysql2', '~>0.5')
@@ -10,7 +10,7 @@
10
10
  module Dbee
11
11
  module Providers
12
12
  class ActiveRecordProvider
13
- VERSION = '1.0.1'
13
+ VERSION = '1.0.2'
14
14
  end
15
15
  end
16
16
  end
@@ -30,15 +30,18 @@ describe Dbee::Providers::ActiveRecordProvider do
30
30
  model_name = snapshot['model_name']
31
31
  query = Dbee::Query.make(snapshot['query'])
32
32
  model = Dbee::Model.make(models[model_name])
33
- expected_sql = snapshot[key].to_s.chomp.tr("\n", ' ')
34
- actual_sql = described_class.new(readable: readable).sql(model, query)
33
+
34
+ expected_5_sql = snapshot[key].to_s.chomp.tr("\n", ' ')
35
+ expected_6_sql = expected_5_sql.gsub(' ', ' ').gsub("'t'", '1').gsub("'f'", '0')
36
+ actual_sql = described_class.new(readable: readable).sql(model, query)
35
37
 
36
38
  error_msg = <<~ERROR_MSG
37
- Expected: #{expected_sql}
38
- Actual: #{actual_sql}
39
+ Expected 5 SQL: #{expected_5_sql}
40
+ Expected 6 SQL: #{expected_6_sql}
41
+ Actual: #{actual_sql}
39
42
  ERROR_MSG
40
43
 
41
- expect(actual_sql).to eq(expected_sql), error_msg
44
+ expect([expected_5_sql, expected_6_sql]).to include(actual_sql), error_msg
42
45
  end
43
46
  end
44
47
  end
@@ -18,7 +18,7 @@ query:
18
18
  value: m
19
19
  - type: equals
20
20
  key_path: active
21
- value: 'false' # notice how the value is a string, but the data model should be setup to be a boolean
21
+ value: 'false'
22
22
  - type: equals
23
23
  key_path: active
24
24
  value: [ true, false, [ null ] ] # test out nested value arrays
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbee-active_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Ruggio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-26 00:00:00.000000000 Z
11
+ date: 2019-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '5'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
19
  version: 5.2.1
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '6'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '5'
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
29
  version: 5.2.1
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '6'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: dbee
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: '1'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 1.0.1
42
+ version: 1.0.2
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: '1'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 1.0.1
52
+ version: 1.0.2
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: guard-rspec
55
55
  requirement: !ruby/object:Gem::Requirement