2012-06-20 12:29:10 -04:00
|
|
|
class UserObserver < ActiveRecord::Observer
|
|
|
|
def after_create(user)
|
2012-09-11 16:24:53 -04:00
|
|
|
log_info("User \"#{user.name}\" (#{user.email}) was created")
|
|
|
|
|
2012-06-20 12:29:10 -04:00
|
|
|
Notify.new_user_email(user.id, user.password).deliver
|
|
|
|
end
|
2012-09-11 16:24:53 -04: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
|
2012-06-20 12:29:10 -04:00
|
|
|
end
|