Commit 61723900 authored by Andrew8xx8's avatar Andrew8xx8

User Teams specific code moved to user_teams controller

parent b49cfbc1
class Projects::ApplicationController < ApplicationController class Projects::ApplicationController < ApplicationController
before_filter :authorize_admin_team_member!
protected
def user_team
@team ||= UserTeam.find_by_path(params[:id])
end
end end
class Projects::TeamsController < Projects::ApplicationController class Projects::TeamsController < Projects::ApplicationController
before_filter :authorize_admin_team_member!
def available def available
@teams = current_user.is_admin? ? UserTeam.scoped : current_user.user_teams @teams = current_user.is_admin? ? UserTeam.scoped : current_user.user_teams
@teams = @teams.without_project(project) @teams = @teams.without_project(project)
...@@ -24,4 +26,9 @@ class Projects::TeamsController < Projects::ApplicationController ...@@ -24,4 +26,9 @@ class Projects::TeamsController < Projects::ApplicationController
redirect_to project_team_index_path(project) redirect_to project_team_index_path(project)
end end
protected
def user_team
@team ||= UserTeam.find_by_path(params[:id])
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