validates_unchangeable 0.1.4 → 0.2.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: eb167db9e8fec2d392c95b590e35133500a4c7b86210dd7d78a6e1dcb6c55a9e
4
- data.tar.gz: 363827134b7ca97596577d6e3a41475b78b1b4b3786214ad248a2c56378284e7
3
+ metadata.gz: a119fb060c9e44688cac373cc1bdd7241571691bccb08fc83a23293594065c2c
4
+ data.tar.gz: 11e1ae55963b6066574745b3035f7bc960dca0e372a5d2b4a2aad457a68d61d5
5
5
  SHA512:
6
- metadata.gz: ff1e8330b660abf8bf5f4e3211ae19bc43033c59750f2c6b48b0892739f22e579e2cc2a89caa6089e5ed01e56a3a04086616f4b01abec439f2db4d6c9e203da4
7
- data.tar.gz: 21b389811e7f2ee29676f8b37484aac8846ee10c6f2669200fb5354eb639a6ed550591df7b73fd1f45347ddce7e65772d64097c07c141bb2e752ed3885106b1e
6
+ metadata.gz: 53155a8b43febcb77dfd1b9dc07f83f00ff0ce5b41dbaf8beb6d128fcd239b21d67c26d02655208c8bff83999b78c5b2897c00b656b15b47902200f4be46823c
7
+ data.tar.gz: 485bd0ae46168331acec4991494f135b15e8ca6e402ab145f4d1169ad2c63a136d2f338523d2fb4ecbe1ab7716ec99ff6ece1cda516afa1f89dd2fadbf14acf7
data/Gemfile.lock CHANGED
@@ -1,74 +1,81 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- validates_unchangeable (0.1.3)
5
- activemodel (>= 5.0, < 7.0)
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 (6.0.3.4)
12
- activesupport (= 6.0.3.4)
13
- activerecord (6.0.3.4)
14
- activemodel (= 6.0.3.4)
15
- activesupport (= 6.0.3.4)
16
- activesupport (6.0.3.4)
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 (>= 0.7, < 2)
19
- minitest (~> 5.1)
20
- tzinfo (~> 1.1)
21
- zeitwerk (~> 2.2, >= 2.2.2)
22
- ast (2.4.1)
23
- concurrent-ruby (1.1.7)
24
- diff-lcs (1.4.4)
25
- i18n (1.8.5)
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
- minitest (5.14.2)
28
- parallel (1.19.2)
29
- parser (2.7.2.0)
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
- rainbow (3.0.0)
34
+ racc
35
+ racc (1.7.1)
36
+ rainbow (3.1.1)
32
37
  rake (10.5.0)
33
- regexp_parser (1.8.1)
34
- rexml (3.2.4)
35
- rspec (3.9.0)
36
- rspec-core (~> 3.9.0)
37
- rspec-expectations (~> 3.9.0)
38
- rspec-mocks (~> 3.9.0)
39
- rspec-core (3.9.3)
40
- rspec-support (~> 3.9.3)
41
- rspec-expectations (3.9.2)
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.9.0)
44
- rspec-mocks (3.9.1)
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.9.0)
47
- rspec-support (3.9.3)
48
- rubocop (0.93.0)
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.7.1.5)
58
+ parser (>= 3.2.2.4)
51
59
  rainbow (>= 2.2.2, < 4.0)
52
- regexp_parser (>= 1.8)
53
- rexml
54
- rubocop-ast (>= 0.6.0)
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 (>= 1.4.0, < 2.0)
57
- rubocop-ast (0.7.1)
58
- parser (>= 2.7.1.5)
59
- ruby-progressbar (1.10.1)
60
- sqlite3 (1.4.2)
61
- thread_safe (0.3.6)
62
- tzinfo (1.2.7)
63
- thread_safe (~> 0.1)
64
- unicode-display_width (1.7.0)
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.0)
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.public_send("#{attribute}_was") == default_value_for(record, attribute) &&
11
- !record.public_send(attribute).nil?)
10
+ (record.try(:new_record?) && !record.public_send(attribute).nil?)
12
11
  return
13
12
  end
14
13
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ValidatesUnchangeable
4
- VERSION = '0.1.4'
4
+ VERSION = '0.2.1'
5
5
  end
@@ -41,6 +41,6 @@ Gem::Specification.new do |spec|
41
41
  spec.add_development_dependency 'rspec', '~> 3.0'
42
42
  spec.add_development_dependency 'rubocop', '> 0.90'
43
43
  spec.add_development_dependency 'sqlite3', '> 0'
44
- spec.add_dependency 'activemodel', '>= 5.0', '< 7.1'
44
+ spec.add_dependency 'activemodel', '>= 5.0'
45
45
  spec.add_dependency 'i18n'
46
46
  end
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.1.4
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vital Ryabchinskiy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-03 00:00:00.000000000 Z
11
+ date: 2024-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -107,9 +107,6 @@ dependencies:
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
109
  version: '5.0'
110
- - - "<"
111
- - !ruby/object:Gem::Version
112
- version: '7.1'
113
110
  type: :runtime
114
111
  prerelease: false
115
112
  version_requirements: !ruby/object:Gem::Requirement
@@ -117,9 +114,6 @@ dependencies:
117
114
  - - ">="
118
115
  - !ruby/object:Gem::Version
119
116
  version: '5.0'
120
- - - "<"
121
- - !ruby/object:Gem::Version
122
- version: '7.1'
123
117
  - !ruby/object:Gem::Dependency
124
118
  name: i18n
125
119
  requirement: !ruby/object:Gem::Requirement
@@ -177,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
171
  - !ruby/object:Gem::Version
178
172
  version: '0'
179
173
  requirements: []
180
- rubygems_version: 3.2.32
174
+ rubygems_version: 3.4.10
181
175
  signing_key:
182
176
  specification_version: 4
183
177
  summary: Library for validating unchangeable attributes.