Commit 63d9373aa8722b69e7263f39af8e5194048b8b0d
1 parent
273c0d2a
Exists in
master
and in
4 other branches
Validates presence of User#name
The 2 reasons are : - creation of user fail if name is empty : in after_save, it tries to create a namespace with namespace.name = user.name and namespece validates presence Namespace#name - in the web app links to team members are broken with empty User#name because they are of the form <a href'...'> user.name </a>
Showing
3 changed files
with
2 additions
and
3 deletions
Show diff stats
app/models/user.rb
... | ... | @@ -62,6 +62,7 @@ class User < ActiveRecord::Base |
62 | 62 | has_many :assigned_issues, class_name: "Issue", foreign_key: :assignee_id, dependent: :destroy |
63 | 63 | has_many :assigned_merge_requests, class_name: "MergeRequest", foreign_key: :assignee_id, dependent: :destroy |
64 | 64 | |
65 | + validates :name, presence: true | |
65 | 66 | validates :bio, length: { within: 0..255 } |
66 | 67 | validates :extern_uid, allow_blank: true, uniqueness: {scope: :provider} |
67 | 68 | validates :projects_limit, presence: true, numericality: {greater_than_or_equal_to: 0} | ... | ... |
doc/api/users.md