generated_schema_validations 0.2.0 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ecc9bdd7f100b8b94562439eb5e8016a0bbe93626f3f4b0d5f34542e57c71f8
4
- data.tar.gz: 83cc0561a14c817b2e7132550e61e2e10bb2a9ac66ad8345303746c222b179aa
3
+ metadata.gz: e8a2504a7047ebe796e668a73b2920b0113e0c38b9c514a5f652f8e524f2696b
4
+ data.tar.gz: 42f4ad881435d17cbad568bf4a704bdb04a3c8ab1d713752ae9401b4f19d0931
5
5
  SHA512:
6
- metadata.gz: 8cc5c081c2351b6c53639a5401cb023135c08ee578d23a966583f6c59d644c3b092cdddff39d45fa617482bc431331a0ae59fc406e324fcc26c6aba2efcbea97
7
- data.tar.gz: a77b5d69e3115c60f32d1f385678ed051bc58fa25fb2187b4871cccda34b57f9b11fb096e07449bf8bba3c9472d5328437b0af7ce06095e14008ea5220e65fd4
6
+ metadata.gz: 730fb6c7de51578b874f0e22d7b02089384849a6fa22252ed105b4b3c74a3ed2bbd9c1ba2f4ed03a2f336a28c49cd5c3e784807375a317434d28b239d613d255
7
+ data.tar.gz: 9e19c517659c728540736cef20a72944cb9ac568268e047888402fd6833c2281e94733b24d858dbb26ffff738eb8138f31fcb29146c0271b80c76623f4cacef9
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ generated_schema_validations-*.gem
data/README.md CHANGED
@@ -27,7 +27,7 @@ To generate `app/models/concerns/schema_validations.rb`:
27
27
 
28
28
  ### Use validations
29
29
 
30
- Add to `app/mode/application_record.rb`:
30
+ Add to `app/models/application_record.rb`:
31
31
 
32
32
  ```ruby
33
33
  class ApplicationRecord < ActiveRecord::Base
@@ -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.2
99
+
100
+ * Enable rails 7.0 usage
101
+
102
+ ### 0.2.1
103
+
104
+ * Close tempfile before reading
105
+
98
106
  ### 0.2.0
99
107
 
100
108
  * Add validations of date and datetime columns to be in database range
@@ -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.0'
5
+ spec.version = '0.2.2'
6
6
  spec.authors = ['Georg Limbach']
7
7
  spec.email = ['georg.limbach@lichtbit.com']
8
8
 
@@ -7,14 +7,14 @@ 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)
14
+ file.close
14
15
 
15
16
  load file.path
16
17
  ensure
17
- file.close
18
18
  file.unlink
19
19
  end
20
20
  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.2.0
4
+ version: 0.2.2
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-01-13 00:00:00.000000000 Z
11
+ date: 2022-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.