gitlabhq/app/observers/user_observer.rb

18 lines
381 B
Ruby
Raw Normal View History

class UserObserver < ActiveRecord::Observer
def after_create(user)
2012-09-11 22:24:53 +02:00
log_info("User \"#{user.name}\" (#{user.email}) was created")
Notify.new_user_email(user.id, user.password).deliver
end
2012-09-11 22:24:53 +02:00
def after_destroy user
log_info("User \"#{user.name}\" (#{user.email}) was removed")
end
protected
def log_info message
Gitlab::AppLogger.info message
end
end