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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f945fc6fc7363b04f3922b55b2670a33ad219aafc78766b01ec5a57a95937673
4
- data.tar.gz: e8dacda120b63acb3958178d4f1cef27740af4b83cbfad705a30a937e588eab1
3
+ metadata.gz: ec486d15b125484090a561e126a11a8d5d733e15b12d5d1c843f481d27ad5ccd
4
+ data.tar.gz: 628a22e24a074a88638c6b807e636ea6c96bd624f2e393493a7285fc89a62879
5
5
  SHA512:
6
- metadata.gz: 07236ca140bb49ec85af5d1b01a62d97b68ac34fba37964ac4a441954dd33ac2bc5caa1b33cd39261117779ee32a74b2c7dd6ca2546bfd4bb230e6663ca980fc
7
- data.tar.gz: b7d3329368dccc9f1de0d2cbecfac601c93924b4378908b775ccf52aee5afb0759be98836547daa1cd02dfc47051ec10c4ef4ec4483e57689821b428b985a68e
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
- with_options(if: -> { respond_to?(:alternate_email) }) do
76
- validates :alternate_email, email: true
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.36.0'.freeze
2
+ VERSION = '2.36.1'.freeze
3
3
  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.0
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-19 00:00:00.000000000 Z
11
+ date: 2026-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails