database_consistency 1.7.0 → 1.7.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: 8049cc73c646f8be58c7f7b3491a0dc02f55f3c75eac32803b850f8c272d11fa
4
- data.tar.gz: fdf3df62bb8df2995889a5c717e22fb437260ebfd77d0bd80bdb5d7b9f90494a
3
+ metadata.gz: 04c8b742c1385fa81e5c0d32ea46904671394ab10d4967551e770715900d5342
4
+ data.tar.gz: df9baa66d00abf4079c89dbcd97280a0398e1cc3d796a83f5b5fde49cb450d6f
5
5
  SHA512:
6
- metadata.gz: e05dcd8d5f1dc062e482a7028f2e10c3232377f1fb7c44609ea41fffb9f14fb3a331db407a693fe5ffe1c0f69d0105e3c39b65166210a6ded5365a1e239ebb50
7
- data.tar.gz: 4dba6ecf15c4f3b6ae3553c28873e23ef77b930a4275124f14b9dfae8b84cb8bfee53033fc4f84a573064c1ebd9b702bb32dddf0fa66c8838e373bb0a372f8ee
6
+ metadata.gz: 3a29b79f54482ae21357bfc5c7aae7fc08b1162156138aa87c5199c159f6297e788a1bd99e6143a381e75ece63d38a4c144dc93497233469ecca2ec0e5d91a7a
7
+ data.tar.gz: d5800c2c487f9a6f3f8a704be26dc0589cbffff1f6b5a3bec6b62874ec22e6ca0a8dcc104e91cc68a96107d17086539e48804f06001b80792a8b94ca6fa73bf1
@@ -24,7 +24,7 @@ module DatabaseConsistency
24
24
  end
25
25
 
26
26
  def preconditions
27
- Helper.postgresql? && column.type == :enum && (enum || inclusion_validator)
27
+ Helper.postgresql? && ActiveRecord::VERSION::MAJOR >= 7 && column.type == :enum && (enum || inclusion_validator)
28
28
  end
29
29
 
30
30
  def check
@@ -6,10 +6,10 @@ module DatabaseConsistency
6
6
  module_function
7
7
 
8
8
  def adapter
9
- if ActiveRecord::Base.respond_to?(:connection_config)
10
- ActiveRecord::Base.connection_config[:adapter]
11
- else
9
+ if ActiveRecord::Base.respond_to?(:connection_db_config)
12
10
  ActiveRecord::Base.connection_db_config.configuration_hash[:adapter]
11
+ else
12
+ ActiveRecord::Base.connection_config[:adapter]
13
13
  end
14
14
  end
15
15
 
@@ -18,10 +18,10 @@ module DatabaseConsistency
18
18
  end
19
19
 
20
20
  def connection_config(klass)
21
- if klass.respond_to?(:connection_config)
22
- klass.connection_config
23
- else
21
+ if klass.respond_to?(:connection_db_config)
24
22
  klass.connection_db_config.configuration_hash
23
+ else
24
+ klass.connection_config
25
25
  end
26
26
  end
27
27
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DatabaseConsistency
4
- VERSION = '1.7.0'
4
+ VERSION = '1.7.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_consistency
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Demin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-05 00:00:00.000000000 Z
11
+ date: 2023-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord