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
Léo-Paul Géneau
gitlab-ce
Commits
0f0c562d
Commit
0f0c562d
authored
Oct 20, 2011
by
Adam Leonard
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
59704f48
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 @
0f0c562d
...
@@ -9,6 +9,7 @@ class UsersProject < ActiveRecord::Base
...
@@ -9,6 +9,7 @@ class UsersProject < ActiveRecord::Base
validates_uniqueness_of
:user_id
,
:scope
=>
[
:project_id
]
validates_uniqueness_of
:user_id
,
:scope
=>
[
:project_id
]
validates_presence_of
:user_id
validates_presence_of
:user_id
validates_presence_of
:project_id
validates_presence_of
:project_id
validate
:user_has_a_role_selected
delegate
:name
,
:email
,
:to
=>
:user
,
:prefix
=>
true
delegate
:name
,
:email
,
:to
=>
:user
,
:prefix
=>
true
...
@@ -18,6 +19,10 @@ class UsersProject < ActiveRecord::Base
...
@@ -18,6 +19,10 @@ class UsersProject < ActiveRecord::Base
end
end
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
end
# == Schema Information
# == 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