Commit 617239000762a01c57b35cbb699f155622ae921a
1 parent
b49cfbc1
Exists in
master
and in
4 other branches
User Teams specific code moved to user_teams controller
Showing
2 changed files
with
7 additions
and
8 deletions
Show diff stats
app/controllers/projects/application_controller.rb
app/controllers/projects/teams_controller.rb
| 1 | 1 | class Projects::TeamsController < Projects::ApplicationController |
| 2 | 2 | |
| 3 | + before_filter :authorize_admin_team_member! | |
| 4 | + | |
| 3 | 5 | def available |
| 4 | 6 | @teams = current_user.is_admin? ? UserTeam.scoped : current_user.user_teams |
| 5 | 7 | @teams = @teams.without_project(project) |
| ... | ... | @@ -24,4 +26,9 @@ class Projects::TeamsController < Projects::ApplicationController |
| 24 | 26 | redirect_to project_team_index_path(project) |
| 25 | 27 | end |
| 26 | 28 | |
| 29 | + protected | |
| 30 | + | |
| 31 | + def user_team | |
| 32 | + @team ||= UserTeam.find_by_path(params[:id]) | |
| 33 | + end | |
| 27 | 34 | end | ... | ... |