Module: Samvera::Persona::UsernameBehavior

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/samvera/persona/username_behavior.rb

Instance Method Summary collapse

Instance Method Details

#check_for_mandatoryObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/models/concerns/samvera/persona/username_behavior.rb', line 9

def check_for_mandatory
  if self.respond_to?(:username)
    if self.email.present? && self.username.blank?
      self.username = self.email
    end
  end

  if self.respond_to?(:uid)
    if self.email.present? && self.uid.blank?
      self.uid = self.email
    end
  end

  true
end