User Teams specific code moved to user_teams controller

This commit is contained in:
Andrew8xx8 2013-03-24 11:57:15 +04:00
parent b49cfbc1d5
commit 6172390007
2 changed files with 7 additions and 8 deletions

View File

@ -1,11 +1,3 @@
class Projects::ApplicationController < ApplicationController
before_filter :authorize_admin_team_member!
protected
def user_team
@team ||= UserTeam.find_by_path(params[:id])
end
end

View File

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