Skip to content

Commit

Permalink
Added method to update an end user's name.
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Youch committed Mar 18, 2010
1 parent 901de65 commit 53cbd78
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/models/end_user.rb
Expand Up @@ -844,9 +844,11 @@ def gallery_can_edit(usr) #:nodoc:
def is_admin?(usr); #:nodoc:
usr.id == self.id; end






def update_name(name, opts={})
return unless self.first_name.blank? && self.last_name.blank? && opts[:force].nil?
name_parts = name.split(' ')
self.first_name = name_parts[0]
self.last_name = name_parts[-1] if name_parts.length > 1
self.save if self.id
end
end

0 comments on commit 53cbd78

Please sign in to comment.