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: 70a54053cb481280797981eb0f5cb1746dc446611de1ef7ed3ee112db984b08b
4
- data.tar.gz: 328ee9c6a2638a317018c69689ca2775f247e8d82fc0038669d5f1d4caa91c57
3
+ metadata.gz: cc227cec06fe251e20eef36cd0d21b05f5014ed6d8a91d18ce23eab11055f99f
4
+ data.tar.gz: ba0b6b325854965b6c9f30d0341c049396757480a0b9cec0428dfc4ec800ef95
5
5
  SHA512:
6
- metadata.gz: c60e7b895927d42d5534cad96bc2918e633f4bd59b77614cbe8712c46539976a4db2d842004027e757f372ddf77f40f7f1e493f395988788aeee82df178a3a85
7
- data.tar.gz: ab1bd36fc0440980e39aa6b2ce18e7311ab38cc2e0a8192aa72818db91be65a5b6bfa47eb0282749a7362f987b63bbe23a13859c5a2c88e0f89d4af85e2e5505
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'generated_schema_validations'
5
- spec.version = '0.2.1'
5
+ spec.version = '0.2.3'
6
6
  spec.authors = ['Georg Limbach']
7
7
  spec.email = ['georg.limbach@lichtbit.com']
8
8
 
@@ -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!('ActiveRecord::Schema', 'GeneratedSchemaValidations::Dumper')
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.1
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: 2022-02-03 00:00:00.000000000 Z
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.