validates_by_schema 0.5.1 → 0.5.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: a0460d1427aec1f4b27e66917d3b708c33f277e799ffb32150f8a34e2317795a
4
- data.tar.gz: e1dd3c76c989ed56df9dfb3d40a912206fcf75ed05d7843ce73c3d3914f99656
3
+ metadata.gz: 6877c59f4c23593b7c11bb834b7ab9cc6cede8bf24a66fb6b3aef6d6d7d8ca20
4
+ data.tar.gz: 3c5bcafcfcaa8b2cf6b902fb2c93e85cdc550fe03c740939b9eeb7f1251b4ae0
5
5
  SHA512:
6
- metadata.gz: 0aa543eb8486c4df7e2be25863a079f81a377da4f0f06a25f6d8878dfc8d075eb78f10b0aeed0caecc9d5fbff653b1c985e1d5cc5abf12e65322c32aacb40a17
7
- data.tar.gz: 30d69fea7343a822b90008d8ba24c8bc46bf4f3f552f00b9c9a6c8db5a9782728a6f6ce4e81dcf16be3cd0150891176571ec99597aa3f0999e057fdd285366ac
6
+ metadata.gz: 692c60647d11664e68d00bdbc7d2a7567277722d3cd95a8a8d608426e7b1d492863301c60ad7e9ffb267af171cdecef22753687cf165e0c68de91c29cfc2768a
7
+ data.tar.gz: 7c96d752cb3f58938e4ae17ff81900d77cf3f6d6a7f76bf320169e5a4136bac62ba87026b1f2f31e03aa4f9279c31e21ac72652eddc4b7259d4ddeeaa1da3f2c
@@ -1,3 +1,3 @@
1
1
  module ValidatesBySchema
2
- VERSION = '0.5.1'
2
+ VERSION = '0.5.2'
3
3
  end
@@ -18,6 +18,9 @@ module ValidatesBySchema
18
18
 
19
19
  def load_schema!
20
20
  super
21
+ # Set flag here to avoid infinite recursion
22
+ @schema_loaded = true
23
+
21
24
  # define schema validations lazy to avoid accessing the database
22
25
  # at class load time.
23
26
  define_schema_validations
@@ -5,4 +5,4 @@ gemspec path: '../..'
5
5
  gem 'simplecov', require: false
6
6
  gem 'simplecov-lcov', require: false
7
7
 
8
- gem 'activerecord', '~> 5.2.0'
8
+ gem 'activerecord', '~> 7.0.0'
@@ -5,4 +5,4 @@ gemspec path: '../..'
5
5
  gem 'simplecov', require: false
6
6
  gem 'simplecov-lcov', require: false
7
7
 
8
- gem 'activerecord', '~> 6.0.0'
8
+ gem 'activerecord', '~> 7.1.0'
@@ -32,7 +32,7 @@ ActiveRecord::Schema.define(version: 20_121_210_034_140) do
32
32
  t.integer 'parent_id', null: false
33
33
  t.integer 'other_id'
34
34
  t.integer 'kind', null: false
35
- t.string 'list', array: true, limit: 3
35
+ t.string 'list', ENV['DB'] == 'postgresql' ? { array: true, limit: 3 } : {}
36
36
 
37
37
  t.index 'parent_id'
38
38
  t.index ['name', 'wheels'], unique: true
data/spec/db/test.sqlite3 CHANGED
Binary file
Binary file
Binary file
@@ -1,7 +1,7 @@
1
1
  require 'widget'
2
2
 
3
3
  class Contraption < Widget
4
- enum kind: %w(one other)
4
+ enum :kind, %w(one other)
5
5
 
6
6
  validates_by_schema
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validates_by_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lewis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-02-28 00:00:00.000000000 Z
12
+ date: 2024-10-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 5.0.0
20
+ version: 6.0.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 5.0.0
27
+ version: 6.0.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: mysql2
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -99,16 +99,16 @@ dependencies:
99
99
  name: sqlite3
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">="
102
+ - - "<"
103
103
  - !ruby/object:Gem::Version
104
- version: '0'
104
+ version: '2.0'
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - ">="
109
+ - - "<"
110
110
  - !ruby/object:Gem::Version
111
- version: '0'
111
+ version: '2.0'
112
112
  description: Keep your code DRY by inferring column validations from table properties!
113
113
  Automagically validate presence, length, numericality, inclusion and uniqueness
114
114
  of ActiveRecord backed columns.
@@ -125,13 +125,13 @@ files:
125
125
  - lib/validates_by_schema.rb
126
126
  - lib/validates_by_schema/validation_option.rb
127
127
  - lib/validates_by_schema/version.rb
128
- - spec/ci/rails50.gemfile
129
- - spec/ci/rails50.gemfile.lock
130
- - spec/ci/rails52.gemfile
131
- - spec/ci/rails60.gemfile
128
+ - spec/ci/rails70.gemfile
129
+ - spec/ci/rails71.gemfile
132
130
  - spec/config/database.yml
133
131
  - spec/config/schema.rb
134
132
  - spec/db/test.sqlite3
133
+ - spec/db/test.sqlite3-shm
134
+ - spec/db/test.sqlite3-wal
135
135
  - spec/spec_helper.rb
136
136
  - spec/support/models/contraption.rb
137
137
  - spec/support/models/gadget.rb
@@ -161,18 +161,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  - !ruby/object:Gem::Version
162
162
  version: '0'
163
163
  requirements: []
164
- rubygems_version: 3.3.26
164
+ rubygems_version: 3.5.16
165
165
  signing_key:
166
166
  specification_version: 4
167
167
  summary: Automatic validation based on your database schema column types and limits.
168
168
  test_files:
169
- - spec/ci/rails50.gemfile
170
- - spec/ci/rails50.gemfile.lock
171
- - spec/ci/rails52.gemfile
172
- - spec/ci/rails60.gemfile
169
+ - spec/ci/rails70.gemfile
170
+ - spec/ci/rails71.gemfile
173
171
  - spec/config/database.yml
174
172
  - spec/config/schema.rb
175
173
  - spec/db/test.sqlite3
174
+ - spec/db/test.sqlite3-shm
175
+ - spec/db/test.sqlite3-wal
176
176
  - spec/spec_helper.rb
177
177
  - spec/support/models/contraption.rb
178
178
  - spec/support/models/gadget.rb
@@ -1,10 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec path: '../..'
4
-
5
- gem 'simplecov', require: false
6
- gem 'simplecov-lcov', require: false
7
-
8
- gem 'activerecord', '~> 5.0.0'
9
-
10
- gem 'sqlite3', '~> 1.3.7'
@@ -1,118 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- validates_by_schema (0.4.0)
5
- activerecord (>= 5.0.0)
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- actionpack (5.0.7.2)
11
- actionview (= 5.0.7.2)
12
- activesupport (= 5.0.7.2)
13
- rack (~> 2.0)
14
- rack-test (~> 0.6.3)
15
- rails-dom-testing (~> 2.0)
16
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
17
- actionview (5.0.7.2)
18
- activesupport (= 5.0.7.2)
19
- builder (~> 3.1)
20
- erubis (~> 2.7.0)
21
- rails-dom-testing (~> 2.0)
22
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
23
- activemodel (5.0.7.2)
24
- activesupport (= 5.0.7.2)
25
- activerecord (5.0.7.2)
26
- activemodel (= 5.0.7.2)
27
- activesupport (= 5.0.7.2)
28
- arel (~> 7.0)
29
- activesupport (5.0.7.2)
30
- concurrent-ruby (~> 1.0, >= 1.0.2)
31
- i18n (>= 0.7, < 2)
32
- minitest (~> 5.1)
33
- tzinfo (~> 1.1)
34
- arel (7.1.4)
35
- builder (3.2.4)
36
- concurrent-ruby (1.1.9)
37
- crass (1.0.6)
38
- diff-lcs (1.4.4)
39
- docile (1.4.0)
40
- erubis (2.7.0)
41
- i18n (1.8.11)
42
- concurrent-ruby (~> 1.0)
43
- loofah (2.12.0)
44
- crass (~> 1.0.2)
45
- nokogiri (>= 1.5.9)
46
- method_source (1.0.0)
47
- mini_portile2 (2.6.1)
48
- minitest (5.14.4)
49
- mysql2 (0.5.3)
50
- nokogiri (1.12.5)
51
- mini_portile2 (~> 2.6.1)
52
- racc (~> 1.4)
53
- pg (1.2.3)
54
- racc (1.6.0)
55
- rack (2.2.3)
56
- rack-test (0.6.3)
57
- rack (>= 1.0)
58
- rails-dom-testing (2.0.3)
59
- activesupport (>= 4.2.0)
60
- nokogiri (>= 1.6)
61
- rails-html-sanitizer (1.4.2)
62
- loofah (~> 2.3)
63
- railties (5.0.7.2)
64
- actionpack (= 5.0.7.2)
65
- activesupport (= 5.0.7.2)
66
- method_source
67
- rake (>= 0.8.7)
68
- thor (>= 0.18.1, < 2.0)
69
- rake (13.0.6)
70
- rspec-core (3.10.1)
71
- rspec-support (~> 3.10.0)
72
- rspec-expectations (3.10.1)
73
- diff-lcs (>= 1.2.0, < 2.0)
74
- rspec-support (~> 3.10.0)
75
- rspec-mocks (3.10.2)
76
- diff-lcs (>= 1.2.0, < 2.0)
77
- rspec-support (~> 3.10.0)
78
- rspec-rails (4.1.2)
79
- actionpack (>= 4.2)
80
- activesupport (>= 4.2)
81
- railties (>= 4.2)
82
- rspec-core (~> 3.10)
83
- rspec-expectations (~> 3.10)
84
- rspec-mocks (~> 3.10)
85
- rspec-support (~> 3.10)
86
- rspec-support (3.10.3)
87
- shoulda-matchers (4.5.1)
88
- activesupport (>= 4.2.0)
89
- simplecov (0.21.2)
90
- docile (~> 1.1)
91
- simplecov-html (~> 0.11)
92
- simplecov_json_formatter (~> 0.1)
93
- simplecov-html (0.12.3)
94
- simplecov-lcov (0.8.0)
95
- simplecov_json_formatter (0.1.3)
96
- sqlite3 (1.3.13)
97
- thor (1.1.0)
98
- thread_safe (0.3.6)
99
- tzinfo (1.2.9)
100
- thread_safe (~> 0.1)
101
-
102
- PLATFORMS
103
- ruby
104
-
105
- DEPENDENCIES
106
- activerecord (~> 5.0.0)
107
- mysql2
108
- pg
109
- rake
110
- rspec-rails
111
- shoulda-matchers
112
- simplecov
113
- simplecov-lcov
114
- sqlite3 (~> 1.3.7)
115
- validates_by_schema!
116
-
117
- BUNDLED WITH
118
- 2.1.4