class User

Attributes

force_random_password[RW]

Public Class Methods

create_from_omniauth(auth, ldap = false) click to toggle source
# File app/models/user.rb, line 55
def create_from_omniauth(auth, ldap = false)
  gitlab_auth.create_from_omniauth(auth, ldap)
end
filter(filter_name) click to toggle source
# File app/models/user.rb, line 41
def filter filter_name
  case filter_name
  when "admins"; self.admins
  when "blocked"; self.blocked
  when "wop"; self.without_projects
  else
    self.active
  end
end
find_for_ldap_auth(auth, signed_in_resource = nil) click to toggle source
# File app/models/user.rb, line 63
def find_for_ldap_auth(auth, signed_in_resource = nil)
  gitlab_auth.find_for_ldap_auth(auth, signed_in_resource)
end
find_or_new_for_omniauth(auth) click to toggle source
# File app/models/user.rb, line 59
def find_or_new_for_omniauth(auth)
  gitlab_auth.find_or_new_for_omniauth(auth)
end
gitlab_auth() click to toggle source
# File app/models/user.rb, line 67
def gitlab_auth
  Gitlab::Auth.new
end
without_projects() click to toggle source
# File app/models/user.rb, line 51
def without_projects
  where('id NOT IN (SELECT DISTINCT(user_id) FROM users_projects)')
end

Public Instance Methods

generate_password() click to toggle source
# File app/models/user.rb, line 76
def generate_password
  if self.force_random_password
    self.password = self.password_confirmation = Devise.friendly_token.first(8)
  end
end