database_consistency 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/database_consistency/checkers/association_checkers/foreign_key_checker.rb +2 -1
- data/lib/database_consistency/checkers/column_checkers/three_state_boolean_checker.rb +2 -1
- data/lib/database_consistency/checkers/validators_fraction_checkers/column_presence_checker.rb +1 -1
- data/lib/database_consistency/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba84801df64868302240abb6b325652bc21c34086c2b4d32460bb092f55d7681
|
4
|
+
data.tar.gz: 49ba63ec3857648e90121ef8e7692fe217fcb41592b21087876628caa7888427
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f29ab6930f1317041b38879890a0195ed03d7620647a08baa5061fd82cd5b124587f0acafa9fe15b1d92747b4a8e7f05528fb4882b170cdf6feb23ed326547aa
|
7
|
+
data.tar.gz: a4e7fb560d24c41aa1dc02ad3127658ac9ab6f268be885843ca03cf24bc49e4354cec95f8d78a69ad44579eaef984a555c578e347eb98645de27248c75edfe3e
|
@@ -12,8 +12,9 @@ module DatabaseConsistency
|
|
12
12
|
|
13
13
|
private
|
14
14
|
|
15
|
+
# column should be a boolean and table shouldn't be a view
|
15
16
|
def preconditions
|
16
|
-
column.type == :boolean
|
17
|
+
column.type == :boolean && model.connection.table_exists?(model.table_name)
|
17
18
|
end
|
18
19
|
|
19
20
|
def check
|
data/lib/database_consistency/checkers/validators_fraction_checkers/column_presence_checker.rb
CHANGED
@@ -19,7 +19,7 @@ module DatabaseConsistency
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def preconditions
|
22
|
-
(regular_column || association) && validators.any?
|
22
|
+
(regular_column || association) && model.connection.table_exists?(model.table_name) && validators.any?
|
23
23
|
end
|
24
24
|
|
25
25
|
def report_template(status, column_name:, error_slug: nil)
|
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.
|
4
|
+
version: 2.0.1
|
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-
|
11
|
+
date: 2024-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|