effective_resources 2.36.0 → 2.36.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 +4 -4
- data/app/models/concerns/effective_devise_user.rb +10 -4
- data/lib/effective_resources/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ec486d15b125484090a561e126a11a8d5d733e15b12d5d1c843f481d27ad5ccd
|
|
4
|
+
data.tar.gz: 628a22e24a074a88638c6b807e636ea6c96bd624f2e393493a7285fc89a62879
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 131a9916144f3f6250a11c0d8287f10d702fd9c224b9f07a0b1e11bb4538f9e07cc7f5ec4eba8dc6c851c210a7a883e38e7fdea07bd7e4bc3a2ef61ba4bc10e2
|
|
7
|
+
data.tar.gz: fae9029e8e0a8a18fe3282f30efd3b69cd16bd42d8a9bd27f5be3565ba0337f7bd8d150441f9fc5dc8d468cf1d7660cdf5d30419736a17cb036404a97956dac4
|
|
@@ -55,6 +55,10 @@ module EffectiveDeviseUser
|
|
|
55
55
|
errors.add(:alternate_email, 'cannot be the same as email') if email.strip.downcase == alternate_email.strip.downcase
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
validate(if: -> { first_name.present? && last_name.present? }) do
|
|
59
|
+
errors.add(:last_name, "can't match first name") if first_name == last_name
|
|
60
|
+
end
|
|
61
|
+
|
|
58
62
|
# Uniqueness validation of emails and alternate emails across all users
|
|
59
63
|
validate(if: -> { respond_to?(:alternate_email) }) do
|
|
60
64
|
records = self.class.where.not(id: id)
|
|
@@ -72,10 +76,8 @@ module EffectiveDeviseUser
|
|
|
72
76
|
end
|
|
73
77
|
end
|
|
74
78
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
+
validates :alternate_email, email: true, if: -> { respond_to?(:alternate_email) }
|
|
80
|
+
validates :public_email, email: true, if: -> { respond_to?(:public_email) }
|
|
79
81
|
end
|
|
80
82
|
|
|
81
83
|
module ClassMethods
|
|
@@ -222,6 +224,10 @@ module EffectiveDeviseUser
|
|
|
222
224
|
to_s
|
|
223
225
|
end
|
|
224
226
|
|
|
227
|
+
def full_name
|
|
228
|
+
[first_name.presence, last_name.presence].compact.join(' ')
|
|
229
|
+
end
|
|
230
|
+
|
|
225
231
|
def alternate_email=(value)
|
|
226
232
|
super(value.to_s.strip.downcase.presence)
|
|
227
233
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: effective_resources
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.36.
|
|
4
|
+
version: 2.36.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Code and Effect
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-03-
|
|
11
|
+
date: 2026-03-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|