# Class UserObserver < ActiveRecord::Observer

- app/observers/user_observer.rb

Methods

A
  - after_create,
  - after_destroy,
  - after_save
L
  - log_info

Instance Public methods
after_create(user) Link

Source: show

    # File app/observers/user_observer.rb, line 2
    def after_create(user)
      log_info("User \"#{user.name}\" (#{user.email}) was created")

      Notify.new_user_email(user.id, user.password).deliver
    end

after_destroy(user) Link

Source: show

    # File app/observers/user_observer.rb, line 8
    def after_destroy user
      log_info("User \"#{user.name}\" (#{user.email})  was removed")
    end

after_save(user) Link

Source: show

    # File app/observers/user_observer.rb, line 12
    def after_save user
      if user.username_changed?
        if user.namespace
          user.namespace.update_attributes(path: user.username)
        else
          user.create_namespace!(path: user.username, name: user.username)
        end
      end
    end

Instance Protected methods
log_info(message) Link

Source: show

    # File app/observers/user_observer.rb, line 24
    def log_info message
      Gitlab::AppLogger.info message
    end