We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb925cb commit 69c0ae9Copy full SHA for 69c0ae9
1 file changed
app/models/profile.rb
@@ -68,6 +68,8 @@ class Profile < ::ResourceRecord
68
validates :region, presence: true, inclusion: {in: REGIONS}
69
validates :sex, presence: true, inclusion: {in: SEXES.values}, allow_blank: true
70
71
+ after_save :run_team_qualification_checks, if: :saved_change_to_sex_or_region?
72
+
73
def telephone_number=(value)
74
parsed = Phonelib.parse(value)
75
super(parsed.valid? ? parsed.e164 : value)
@@ -88,6 +90,14 @@ def completed?
88
90
89
91
private
92
93
+ def saved_change_to_sex_or_region?
94
+ saved_change_to_sex? || saved_change_to_region?
95
+ end
96
97
+ def run_team_qualification_checks
98
+ team&.run_qualification_checks
99
100
101
def skillsets_must_be_valid
102
return if skillsets.blank?
103
0 commit comments