BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
98044f0f
Commit
98044f0f
authored
Dec 26, 2012
by
Andrey Kumanyaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code duplication removed from controllers
parent
39e7a0ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
groups_controller.rb
app/controllers/admin/groups_controller.rb
+1
-3
groups_controller.rb
app/controllers/groups_controller.rb
+1
-3
group.rb
app/models/group.rb
+6
-0
No files found.
app/controllers/admin/groups_controller.rb
View file @
98044f0f
...
...
@@ -68,9 +68,7 @@ class Admin::GroupsController < AdminController
end
def
project_teams_update
@group
.
projects
.
each
do
|
project
|
project
.
add_users_ids_to_team
(
params
[
:user_ids
],
params
[
:project_access
])
end
@group
.
add_users_to_project_teams
(
params
[
:user_ids
],
params
[
:project_access
])
redirect_to
[
:admin
,
@group
],
notice:
'Users was successfully added.'
end
...
...
app/controllers/groups_controller.rb
View file @
98044f0f
...
...
@@ -59,9 +59,7 @@ class GroupsController < ApplicationController
end
def
team_members
@group
.
projects
.
each
do
|
project
|
project
.
add_users_ids_to_team
(
params
[
:user_ids
],
params
[
:project_access
])
end
@group
.
add_users_to_project_teams
(
params
[
:user_ids
],
params
[
:project_access
])
redirect_to
people_group_path
(
@group
),
notice:
'Users was successfully added.'
end
...
...
app/models/group.rb
View file @
98044f0f
...
...
@@ -12,6 +12,12 @@
#
class
Group
<
Namespace
def
add_users_to_project_teams
(
user_ids
,
project_access
)
projects
.
each
do
|
project
|
project
.
add_users_ids_to_team
(
user_ids
,
project_access
)
end
end
def
users
users
=
User
.
joins
(
:users_projects
).
where
(
users_projects:
{
project_id:
project_ids
})
users
=
users
<<
owner
...
...
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