can_has_validations 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35a018491f2cdaaf42b335b1d161573555a41b10f3a01b3789e51afbc8b75a0e
4
- data.tar.gz: acfa4a74d6709f9184fe46d24eef3fa36771c0f1a540fdbd1d75682b49e67bf8
3
+ metadata.gz: a60d6f36d2de2de081e45e2608c207d3cc81447900b2f0c7ef61727373fb2819
4
+ data.tar.gz: aed858aa2888e7646b3878dd039052b0196d9a41e64188bcf45f494dc3bb0e6d
5
5
  SHA512:
6
- metadata.gz: ea6a073102cae7965b1f430c169db660f16fcbb826271016a991fef4888401fbb0da206dcd030c61bdf4aab04100d934eaa6efbb76fb12f276f25a1ae30c6a04
7
- data.tar.gz: 328d8fe59d6e527cc5373a1193654a689c3ff418573b4114fe358475ab5ce1c2a8e64e00ac85bd04cc5a55bd090c276cad4f19711c0919baae6895627958c455
6
+ metadata.gz: db744b1438739df7fd6aae9d071ccbae7683c405fab61ff56307045d2312760b8559b950246a8c578aa3e58c6fdff3d0bbe8f7a27c520d95ea92902b9ef2ef52
7
+ data.tar.gz: 17486807b2bede046e96282943b8dfa76154e4283d20b8ec18958154f75a24508e919786f2b5e2f802315ee4246c41bfa187b24f93769e67d14767496c34c419
@@ -18,7 +18,9 @@ module ActiveModel::Validations
18
18
 
19
19
  def validate_each(record, attribute, _)
20
20
  return unless record.persisted?
21
- if !record.respond_to?("#{attribute}_changed?") && record.respond_to?("#{attribute}_id_changed?")
21
+ if ( !record.respond_to?("#{attribute}_changed?") ||
22
+ !record.respond_to?("#{attribute}_was")
23
+ ) && record.respond_to?("#{attribute}_id_changed?")
22
24
  attr2 = "#{attribute}_id"
23
25
  else
24
26
  attr2 = attribute
@@ -1,3 +1,3 @@
1
1
  module CanHasValidations
2
- VERSION = '1.4.0'
2
+ VERSION = '1.5.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: can_has_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thomas morgan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-12 00:00:00.000000000 Z
11
+ date: 2021-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: '5.2'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '6.2'
22
+ version: '7.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '5.0'
29
+ version: '5.2'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '6.2'
32
+ version: '7.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: sqlite3
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -44,7 +44,7 @@ dependencies:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
- description: 'Assorted Rails 5.x-6.x validators: Array, Email, Existence, Grandparent,
47
+ description: 'Assorted Rails 5.x-7.x validators: Array, Email, Existence, Grandparent,
48
48
  Hash keys, Hash values, Hostname, IP address, Ordering, URL, Write Once'
49
49
  email:
50
50
  - tm@iprog.com
@@ -124,7 +124,7 @@ requirements: []
124
124
  rubygems_version: 3.2.22
125
125
  signing_key:
126
126
  specification_version: 4
127
- summary: Assorted Rails 5.x-6.x validators
127
+ summary: Assorted Rails 5.x-7.x validators
128
128
  test_files:
129
129
  - test/can_has_validations_test.rb
130
130
  - test/dummy/README.rdoc