generated_schema_validations 0.2.1 → 0.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc227cec06fe251e20eef36cd0d21b05f5014ed6d8a91d18ce23eab11055f99f
|
4
|
+
data.tar.gz: ba0b6b325854965b6c9f30d0341c049396757480a0b9cec0428dfc4ec800ef95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21dc22f43b73d4782f1ca0b4071f53efbb17b84255d94c8a9f5c97cfed19e24871b10ba0c85bd7354cb3ad9b480406b521b2408e9e57fbd6e58b1f18aa3b22f6
|
7
|
+
data.tar.gz: d1b6d05f58c67a63d04429c4c4ddf4b91edf8838c9bd7a15216045277a077ef52aced4ede41b9a0c0c7a24cdff0844bd67bc14f25136059bd37d03c69c66a81c
|
data/README.md
CHANGED
@@ -95,6 +95,14 @@ You can watch changes on `schema_validations.rb` to understand the generated val
|
|
95
95
|
|
96
96
|
## Changelog
|
97
97
|
|
98
|
+
### 0.2.3
|
99
|
+
|
100
|
+
* Add `jsonb` and `xml` as possible field type
|
101
|
+
|
102
|
+
### 0.2.2
|
103
|
+
|
104
|
+
* Enable rails 7.0 usage
|
105
|
+
|
98
106
|
### 0.2.1
|
99
107
|
|
100
108
|
* Close tempfile before reading
|
@@ -7,7 +7,7 @@ class GeneratedSchemaValidations::Dumper
|
|
7
7
|
file = Tempfile.new(['schema', '.rb'])
|
8
8
|
begin
|
9
9
|
schema_content = File.read(Rails.root.join('db/schema.rb'))
|
10
|
-
schema_content.gsub!(
|
10
|
+
schema_content.gsub!(/ActiveRecord::Schema(\[[^\]]+\])?/, 'GeneratedSchemaValidations::Dumper')
|
11
11
|
raise 'The scheme is not well-formed.' if schema_content.include?('ActiveRecord')
|
12
12
|
|
13
13
|
file.write(schema_content)
|
@@ -100,6 +100,14 @@ class GeneratedSchemaValidations::Table
|
|
100
100
|
null_validation(:json, name, column_options)
|
101
101
|
end
|
102
102
|
|
103
|
+
def jsonb(name, column_options = {})
|
104
|
+
null_validation(:jsonb, name, column_options)
|
105
|
+
end
|
106
|
+
|
107
|
+
def xml(name, column_options = {})
|
108
|
+
null_validation(:xml, name, column_options)
|
109
|
+
end
|
110
|
+
|
103
111
|
def decimal(name, column_options = {})
|
104
112
|
null_validation(:decimal, name, column_options)
|
105
113
|
return if column_options[:array]
|
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.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Georg Limbach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-28 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.
|