Merge pull request #2261 from jouve/fix_user_validation

Validates presence of User#name
This commit is contained in:
Valeriy Sizov 2012-12-12 09:47:56 -08:00
commit b48852e789
3 changed files with 2 additions and 3 deletions

View file

@ -62,6 +62,7 @@ class User < ActiveRecord::Base
has_many :assigned_issues, class_name: "Issue", foreign_key: :assignee_id, dependent: :destroy has_many :assigned_issues, class_name: "Issue", foreign_key: :assignee_id, dependent: :destroy
has_many :assigned_merge_requests, class_name: "MergeRequest", foreign_key: :assignee_id, dependent: :destroy has_many :assigned_merge_requests, class_name: "MergeRequest", foreign_key: :assignee_id, dependent: :destroy
validates :name, presence: true
validates :bio, length: { within: 0..255 } validates :bio, length: { within: 0..255 }
validates :extern_uid, allow_blank: true, uniqueness: {scope: :provider} validates :extern_uid, allow_blank: true, uniqueness: {scope: :provider}
validates :projects_limit, presence: true, numericality: {greater_than_or_equal_to: 0} validates :projects_limit, presence: true, numericality: {greater_than_or_equal_to: 0}

View file

@ -75,7 +75,7 @@ POST /users
Parameters: Parameters:
+ `email` (required) - Email + `email` (required) - Email
+ `password` (required) - Password + `password` (required) - Password
+ `name` - Name + `name` (required) - Name
+ `skype` - Skype ID + `skype` - Skype ID
+ `linkedin` - Linkedin + `linkedin` - Linkedin
+ `twitter` - Twitter account + `twitter` - Twitter account

View file

@ -101,8 +101,6 @@ module Gitlab
key = current_user.keys.find params[:id] key = current_user.keys.find params[:id]
key.delete key.delete
end end
end end
end end
end end