generated_schema_validations 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/generated_schema_validations.gemspec +1 -1
- data/lib/generated_schema_validations/table.rb +2 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6695669fe5683c58ba70f717c3025fff4e51baa0684842603cede227bfed0b83
|
4
|
+
data.tar.gz: 80b7ee3f1f023b56704928fc02ddd1930028449ab4162bb9ab48fd0c8ef3049b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48749688026b1328a620e9d820367e5dc2adbe294a38265aecc3e1d3755d227671b86cf104788d8dce9165d87ca0b5d9ba8a2e4387a02b0538ce830dc1ed7196
|
7
|
+
data.tar.gz: fa8fbd3809827765f766962bd928157a058ef68b41e0dc414de706d178b2b64884cf519d4069d54493dcfe851d95f33e571036cfec2f10b413b8bbaf5a455227
|
data/README.md
CHANGED
@@ -97,6 +97,10 @@ You can watch changes on `schema_validations.rb` to understand the generated val
|
|
97
97
|
|
98
98
|
## Changelog
|
99
99
|
|
100
|
+
### 0.4
|
101
|
+
|
102
|
+
* JSON and JSONB fields can have an empty hash and still be considered present
|
103
|
+
|
100
104
|
### 0.3.1
|
101
105
|
|
102
106
|
* Add exclusion for enum fields
|
@@ -55,6 +55,8 @@ class GeneratedSchemaValidations::Table
|
|
55
55
|
@possible_belongs_to_not_null_columns.push(name.to_sym) if datatype.in?(%i[bigint integer uuid])
|
56
56
|
if datatype == :boolean
|
57
57
|
validates name, :inclusion, in: [true, false], message: :blank
|
58
|
+
elsif datatype.in?(%i[json jsonb])
|
59
|
+
validates name, :exclusion, in: [nil], message: :blank
|
58
60
|
else
|
59
61
|
validates name, :presence
|
60
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: generated_schema_validations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Georg Limbach
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: After each migration it generates a file with some validations. Each
|
14
14
|
active record should include this file and can uns generated validations.
|
@@ -38,7 +38,7 @@ licenses:
|
|
38
38
|
metadata:
|
39
39
|
homepage_uri: https://github.com/Lichtbit/generated_schema_validations
|
40
40
|
source_code_uri: https://github.com/Lichtbit/generated_schema_validations
|
41
|
-
post_install_message:
|
41
|
+
post_install_message:
|
42
42
|
rdoc_options: []
|
43
43
|
require_paths:
|
44
44
|
- lib
|
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
54
|
version: '0'
|
55
55
|
requirements: []
|
56
56
|
rubygems_version: 3.3.26
|
57
|
-
signing_key:
|
57
|
+
signing_key:
|
58
58
|
specification_version: 4
|
59
59
|
summary: Generate rails validations from schema.rb file
|
60
60
|
test_files: []
|