Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
7b335893
Commit
7b335893
authored
Oct 20, 2011
by
Adam Leonard
Committed by
Dmitriy Zaporozhets
Oct 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add check to ensure that a team member has atleast one Access Role selected
parent
565ec8a1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
app/models/users_project.rb
app/models/users_project.rb
+6
-1
No files found.
app/models/users_project.rb
View file @
7b335893
...
...
@@ -9,6 +9,7 @@ class UsersProject < ActiveRecord::Base
validates_uniqueness_of
:user_id
,
:scope
=>
[
:project_id
]
validates_presence_of
:user_id
validates_presence_of
:project_id
validate
:user_has_a_role_selected
delegate
:name
,
:email
,
:to
=>
:user
,
:prefix
=>
true
...
...
@@ -18,6 +19,10 @@ class UsersProject < ActiveRecord::Base
end
end
def
user_has_a_role_selected
errors
.
add
(
:base
,
"Please choose at least one Role in the Access list"
)
unless
read
||
write
||
admin
end
end
# == Schema Information
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment