generated_schema_validations 0.6.0 → 0.6.1
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 +4 -7
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ec2ac3a0961cac39ac98ad2b31f7c81d9858f50c0170c2f0ec49cf71df766806
|
|
4
|
+
data.tar.gz: 117604c47ecae3fabd1c7199ea92e6b076d78b2131313e7998176e4d4d7bcd0b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 716aa6fed3746fb60b25ec359eccfe282814ee86d3207e4bbac2001099a1f54bf61b552622e91c88046abb275b4b9c4495360e9e950c914fb55e7141625ef475
|
|
7
|
+
data.tar.gz: e4669b5032d78f2b3583cee3895c99c61cdb020459853bd281e9e9f6f82d6dc7395eb8a24a6de67850545a70403dc500ccfcdc691f5a5479d8d81d16f40756d6
|
data/README.md
CHANGED
|
@@ -105,6 +105,10 @@ You can watch changes on `schema_validations.rb` to understand the generated val
|
|
|
105
105
|
|
|
106
106
|
## Changelog
|
|
107
107
|
|
|
108
|
+
### 0.6.1
|
|
109
|
+
|
|
110
|
+
* adds support for Rails 8.1 (integer range validations no longer use the private `ActiveRecord::Type::Integer#range`, which was removed in Rails 8.1)
|
|
111
|
+
|
|
108
112
|
### 0.6.0
|
|
109
113
|
|
|
110
114
|
* add a relaxed mode for model validations in migrations
|
|
@@ -83,13 +83,10 @@ class GeneratedSchemaValidations::Table
|
|
|
83
83
|
|
|
84
84
|
return if column_options[:array]
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
else
|
|
91
|
-
options[:less_than_or_equal_to] = integer_range.end
|
|
92
|
-
end
|
|
86
|
+
# Same bounds as ActiveModel::Type::Integer (min...max), computed here because
|
|
87
|
+
# Rails 8.1 removed the private #range method this used to call.
|
|
88
|
+
max_value = 1 << ((::ActiveRecord::Type::Integer::DEFAULT_LIMIT * 8) - 1)
|
|
89
|
+
options = { allow_nil: true, only_integer: true, greater_than_or_equal_to: -max_value, less_than: max_value }
|
|
93
90
|
|
|
94
91
|
validates_without_enum name, :numericality, options
|
|
95
92
|
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.6.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Georg Limbach
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-10-17 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.
|
|
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
55
55
|
- !ruby/object:Gem::Version
|
|
56
56
|
version: '0'
|
|
57
57
|
requirements: []
|
|
58
|
-
rubygems_version: 3.
|
|
58
|
+
rubygems_version: 3.4.20
|
|
59
59
|
signing_key:
|
|
60
60
|
specification_version: 4
|
|
61
61
|
summary: Generate rails validations from schema.rb file
|