database_consistency 2.0.2 → 2.0.3

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: 00b035e08de638007e2b5c13042544597dcdf30a4ea55b1a97dd4e55e16e7a1a
4
- data.tar.gz: 9c6db1c345e64d271680c0e6effa6c84d72e2a6d4bde388a123f8ca109d157c3
3
+ metadata.gz: 10a47440f23b099f99610cd51a5150d741c36f439db1b41ed013c7e471d055e2
4
+ data.tar.gz: d41e1338822d6bde0dda339d1be9f1e719559c493d6ed93df2fe430457155ef9
5
5
  SHA512:
6
- metadata.gz: 9b322ecb69172489a441031d971c5fcdea5e68d6ed6a31486dfe36cbab349f4ffb184970f35b1cf55585398b281b82db0916fb956bc276534f42907f62ae6e32
7
- data.tar.gz: 22e56221e6711045aaeecedfc305914d8363817c19d376d4a46e89eb3e7d17ad379213e7e07a080ee2f8734679688e9b3d8690f16f5d5097809fae466072472f
6
+ metadata.gz: 48cffa667822acc96791b45f2c5821cd3920ed217d451340361d8184dac927843755940443e2e4506358847736687aab5d4adbe1c68e5f3db08da35d9b9a1ff9
7
+ data.tar.gz: bfe3e7df7e47c4988aeae5fe9c2157786c221047fec5a0f9f435457020f65d99ebb2722c94ddce4204ed84a49ffdab8849fc85ab5e282d39722bcf68ddd4e9cd
@@ -34,11 +34,15 @@ module DatabaseConsistency
34
34
  ].compact
35
35
  end
36
36
 
37
- def enum_column_values
38
- @enum_column_values ||= begin
39
- _, values = model.connection.enum_types.find { |(enum, _)| enum == column.sql_type }
40
- values.split(',').map(&:strip)
41
- end
37
+ def enum_column_values # rubocop:disable Metrics/AbcSize
38
+ @enum_column_values ||=
39
+ if model.connection.enum_types.is_a?(Array)
40
+ _, values = model.connection.enum_types.find { |(enum, _)| enum == column.sql_type }
41
+ values.split(',').map(&:strip)
42
+ else
43
+ # active_record-postgres_enum gem
44
+ model.connection.enum_types[column.sql_type.to_sym]
45
+ end
42
46
  end
43
47
 
44
48
  def verify_enum
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DatabaseConsistency
4
- VERSION = '2.0.2'
4
+ VERSION = '2.0.3'
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: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Demin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-26 00:00:00.000000000 Z
11
+ date: 2025-01-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord