Skip to content

Commit

Permalink
Can add a handler to be notified that the end user is changing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Youch committed Aug 12, 2010
1 parent bd2a113 commit 7529bbb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/models/end_user.rb
Expand Up @@ -461,6 +461,12 @@ def triggered_attributes
@triggered_attributes ||= self.attributes.merge(:name => self.name)
end

def before_update #:nodoc:
self.get_handler_info(:end_user, :before_update).each do |handler|
handler[:class].end_user_updated self
end
end

def before_save #:nodoc:
if self.password && !self.password.empty?
self.salt = EndUser.generate_hash if self.salt.blank?
Expand Down

0 comments on commit 7529bbb

Please sign in to comment.