validates_unchangeable 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +56 -49
- data/lib/validates_unchangeable/active_model.rb +1 -2
- data/lib/validates_unchangeable/version.rb +1 -1
- 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: 8496a5c4702e11672fa9b58cfa0d93643fe2e59995961239a526a581b0956391
|
4
|
+
data.tar.gz: 73ef253d8302ac9f664785c63275db8fb734ef5f8cd219642a51a8fb03739b35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b552c960a02b9363d448db2d6e0e149e8825119b9c485c70f53b6c78d7e663fdd9e3b3aeb7c8f7a6770e60c39d2acbf2dcb80ac80b3ba830abb9f2f48322a060
|
7
|
+
data.tar.gz: 85d86ce254f63d2e2fa768ea499e2e0cb6cbf95f7104e0031b504488999be02c8016197aa1195f3dae52ede6305b7feea9b08cb0c93e91e7c61deeaae37143b0
|
data/Gemfile.lock
CHANGED
@@ -1,74 +1,81 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
validates_unchangeable (0.1.
|
5
|
-
activemodel (>= 5.0, < 7.
|
4
|
+
validates_unchangeable (0.1.4)
|
5
|
+
activemodel (>= 5.0, < 7.1)
|
6
6
|
i18n
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activemodel (
|
12
|
-
activesupport (=
|
13
|
-
activerecord (
|
14
|
-
activemodel (=
|
15
|
-
activesupport (=
|
16
|
-
activesupport (
|
11
|
+
activemodel (7.0.8)
|
12
|
+
activesupport (= 7.0.8)
|
13
|
+
activerecord (7.0.8)
|
14
|
+
activemodel (= 7.0.8)
|
15
|
+
activesupport (= 7.0.8)
|
16
|
+
activesupport (7.0.8)
|
17
17
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
|
-
i18n (>=
|
19
|
-
minitest (
|
20
|
-
tzinfo (~>
|
21
|
-
|
22
|
-
|
23
|
-
concurrent-ruby (1.
|
24
|
-
diff-lcs (1.
|
25
|
-
i18n (1.
|
18
|
+
i18n (>= 1.6, < 2)
|
19
|
+
minitest (>= 5.1)
|
20
|
+
tzinfo (~> 2.0)
|
21
|
+
ast (2.4.2)
|
22
|
+
base64 (0.1.1)
|
23
|
+
concurrent-ruby (1.2.2)
|
24
|
+
diff-lcs (1.5.0)
|
25
|
+
i18n (1.14.1)
|
26
26
|
concurrent-ruby (~> 1.0)
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
json (2.6.3)
|
28
|
+
language_server-protocol (3.17.0.3)
|
29
|
+
mini_portile2 (2.8.5)
|
30
|
+
minitest (5.20.0)
|
31
|
+
parallel (1.23.0)
|
32
|
+
parser (3.2.2.4)
|
30
33
|
ast (~> 2.4.1)
|
31
|
-
|
34
|
+
racc
|
35
|
+
racc (1.7.1)
|
36
|
+
rainbow (3.1.1)
|
32
37
|
rake (10.5.0)
|
33
|
-
regexp_parser (
|
34
|
-
rexml (3.2.
|
35
|
-
rspec (3.
|
36
|
-
rspec-core (~> 3.
|
37
|
-
rspec-expectations (~> 3.
|
38
|
-
rspec-mocks (~> 3.
|
39
|
-
rspec-core (3.
|
40
|
-
rspec-support (~> 3.
|
41
|
-
rspec-expectations (3.
|
38
|
+
regexp_parser (2.8.2)
|
39
|
+
rexml (3.2.6)
|
40
|
+
rspec (3.12.0)
|
41
|
+
rspec-core (~> 3.12.0)
|
42
|
+
rspec-expectations (~> 3.12.0)
|
43
|
+
rspec-mocks (~> 3.12.0)
|
44
|
+
rspec-core (3.12.2)
|
45
|
+
rspec-support (~> 3.12.0)
|
46
|
+
rspec-expectations (3.12.3)
|
42
47
|
diff-lcs (>= 1.2.0, < 2.0)
|
43
|
-
rspec-support (~> 3.
|
44
|
-
rspec-mocks (3.
|
48
|
+
rspec-support (~> 3.12.0)
|
49
|
+
rspec-mocks (3.12.6)
|
45
50
|
diff-lcs (>= 1.2.0, < 2.0)
|
46
|
-
rspec-support (~> 3.
|
47
|
-
rspec-support (3.
|
48
|
-
rubocop (
|
51
|
+
rspec-support (~> 3.12.0)
|
52
|
+
rspec-support (3.12.1)
|
53
|
+
rubocop (1.57.1)
|
54
|
+
base64 (~> 0.1.1)
|
55
|
+
json (~> 2.3)
|
56
|
+
language_server-protocol (>= 3.17.0)
|
49
57
|
parallel (~> 1.10)
|
50
|
-
parser (>= 2.
|
58
|
+
parser (>= 3.2.2.4)
|
51
59
|
rainbow (>= 2.2.2, < 4.0)
|
52
|
-
regexp_parser (>= 1.8)
|
53
|
-
rexml
|
54
|
-
rubocop-ast (>=
|
60
|
+
regexp_parser (>= 1.8, < 3.0)
|
61
|
+
rexml (>= 3.2.5, < 4.0)
|
62
|
+
rubocop-ast (>= 1.28.1, < 2.0)
|
55
63
|
ruby-progressbar (~> 1.7)
|
56
|
-
unicode-display_width (>=
|
57
|
-
rubocop-ast (
|
58
|
-
parser (>= 2.
|
59
|
-
ruby-progressbar (1.
|
60
|
-
sqlite3 (1.
|
61
|
-
|
62
|
-
tzinfo (
|
63
|
-
|
64
|
-
unicode-display_width (
|
65
|
-
zeitwerk (2.4.0)
|
64
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
65
|
+
rubocop-ast (1.29.0)
|
66
|
+
parser (>= 3.2.1.0)
|
67
|
+
ruby-progressbar (1.13.0)
|
68
|
+
sqlite3 (1.6.7)
|
69
|
+
mini_portile2 (~> 2.8.0)
|
70
|
+
tzinfo (2.0.6)
|
71
|
+
concurrent-ruby (~> 1.0)
|
72
|
+
unicode-display_width (2.5.0)
|
66
73
|
|
67
74
|
PLATFORMS
|
68
75
|
ruby
|
69
76
|
|
70
77
|
DEPENDENCIES
|
71
|
-
activerecord (>= 5.0, < 7.
|
78
|
+
activerecord (>= 5.0, < 7.1)
|
72
79
|
bundler
|
73
80
|
rake (~> 10.0)
|
74
81
|
rspec (~> 3.0)
|
@@ -7,8 +7,7 @@ module ActiveModel
|
|
7
7
|
class UnchangeableValidator < ActiveModel::EachValidator
|
8
8
|
def validate_each(record, attribute, _value)
|
9
9
|
if !record.public_send("#{attribute}_changed?") ||
|
10
|
-
(record.
|
11
|
-
!record.public_send(attribute).nil?)
|
10
|
+
(record.try(:new_record?) && !record.public_send(attribute).nil?)
|
12
11
|
return
|
13
12
|
end
|
14
13
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validates_unchangeable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vital Ryabchinskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
177
|
- !ruby/object:Gem::Version
|
178
178
|
version: '0'
|
179
179
|
requirements: []
|
180
|
-
rubygems_version: 3.
|
180
|
+
rubygems_version: 3.4.10
|
181
181
|
signing_key:
|
182
182
|
specification_version: 4
|
183
183
|
summary: Library for validating unchangeable attributes.
|