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 +4 -4
- data/.rubocop.yml +3 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +5 -0
- data/dbee-active_record.gemspec +14 -2
- data/lib/dbee/providers/active_record_provider/version.rb +1 -1
- data/spec/dbee/providers/active_record_provider_spec.rb +8 -5
- data/spec/fixtures/active_record_snapshots/one_table_query_with_filters.yaml +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec33481a6a1eb0dd9ddb60ace985456f5e8d085559d8923607bb252c013498de
|
4
|
+
data.tar.gz: 49fe65ebf0caeb1f0e87482309352ed0e258cfd57c2ab26e2c3867d2c7e4a27a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44d6130ac9b617fddc0943caeabc65576e5617eac9bad7367757ab8ddff1dc98e3e542b9ec564da20f4d1c3c3e1094b8c4e8e27156e76ddea248d12afb38e570
|
7
|
+
data.tar.gz: 7288cd2c2cbb0ee5e57278aa0d5ec308dc0c3dfeb8fe032cb5a50c5e9c42f2110388fd3933d2a46199fea901fda10509359c422e19d9be9d55e9228e449a292a
|
data/.rubocop.yml
CHANGED
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
data/dbee-active_record.gemspec
CHANGED
@@ -21,8 +21,20 @@ Gem::Specification.new do |s|
|
|
21
21
|
|
22
22
|
s.required_ruby_version = '>= 2.4.6'
|
23
23
|
|
24
|
-
|
25
|
-
|
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')
|
@@ -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
|
-
|
34
|
-
|
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: #{
|
38
|
-
|
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(
|
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'
|
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.
|
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-
|
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.
|
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.
|
52
|
+
version: 1.0.2
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: guard-rspec
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|