Commit b48852e7 authored by Valeriy Sizov's avatar Valeriy Sizov
Browse files

Merge pull request #2261 from jouve/fix_user_validation

Validates presence of User#name
......@@ -62,6 +62,7 @@ class User < ActiveRecord::Base
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
validates :name, presence: true
validates :bio, length: { within: 0..255 }
validates :extern_uid, allow_blank: true, uniqueness: {scope: :provider}
validates :projects_limit, presence: true, numericality: {greater_than_or_equal_to: 0}
......
......@@ -75,7 +75,7 @@ POST /users
Parameters:
+ `email` (required) - Email
+ `password` (required) - Password
+ `name` - Name
+ `name` (required) - Name
+ `skype` - Skype ID
+ `linkedin` - Linkedin
+ `twitter` - Twitter account
......
......@@ -101,8 +101,6 @@ class Users < Grape::API
key = current_user.keys.find params[:id]
key.delete
end
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment