Skip to content

Commit

Permalink
Set email before save
Browse files Browse the repository at this point in the history
  • Loading branch information
bess committed Dec 18, 2017
1 parent a31204b commit 226f8f5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,8 @@ def mailboxer_email(_object)
def preferred_locale
'en'
end

def ldap_before_save
self.email = Devise::LDAP::Adapter.get_ldap_param(self.username,"mail").first
end
end

0 comments on commit 226f8f5

Please sign in to comment.