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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d682dd2bd139df00dace4687523703c49ab9f139c8a62f4360b584844ee22af
4
- data.tar.gz: 46c6c3531d0dd45f4e4c2a92ff98825f961e914916a9970f5d161f53e172250e
3
+ metadata.gz: ec2ac3a0961cac39ac98ad2b31f7c81d9858f50c0170c2f0ec49cf71df766806
4
+ data.tar.gz: 117604c47ecae3fabd1c7199ea92e6b076d78b2131313e7998176e4d4d7bcd0b
5
5
  SHA512:
6
- metadata.gz: 35197994299293c9ce253a9bb65f9c6f3a219250f8275048694ac460837850ad4f5620764641fb95ca1ff6793e5c46c2cc4774742d222927e13a8d1b0f2369b8
7
- data.tar.gz: 1c9cb3dfd84a6fe456664d7d3e9eb9cb4892d7083155abbebc573872a52c3aca0704b30c7b682006296a688eec048bd425bf69e4994b2f476c96d2bd8b96b222
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'generated_schema_validations'
5
- spec.version = '0.6.0'
5
+ spec.version = '0.6.1'
6
6
  spec.authors = ['Georg Limbach']
7
7
  spec.email = ['georg.limbach@lichtbit.com']
8
8
 
@@ -83,13 +83,10 @@ class GeneratedSchemaValidations::Table
83
83
 
84
84
  return if column_options[:array]
85
85
 
86
- integer_range = ::ActiveRecord::Type::Integer.new.send(:range)
87
- options = { allow_nil: true, only_integer: true, greater_than_or_equal_to: integer_range.begin }
88
- if integer_range.exclude_end?
89
- options[:less_than] = integer_range.end
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.0
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-08-19 00:00:00.000000000 Z
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.3.26
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