From 17a8ee57fe7a2c2b7c18c59f88828be9d5a455a0 Mon Sep 17 00:00:00 2001 From: Andrey Kumanyaev Date: Mon, 21 Jan 2013 01:05:51 +0400 Subject: [PATCH] Remove old data --- app/controllers/admin/teams_controller.rb | 35 ----------------------- app/models/users_project.rb | 2 +- config/routes.rb | 6 ---- 3 files changed, 1 insertion(+), 42 deletions(-) diff --git a/app/controllers/admin/teams_controller.rb b/app/controllers/admin/teams_controller.rb index 5d9356e9..ee9141e3 100644 --- a/app/controllers/admin/teams_controller.rb +++ b/app/controllers/admin/teams_controller.rb @@ -60,41 +60,6 @@ class Admin::TeamsController < Admin::ApplicationController redirect_to admin_user_teams_path, notice: 'UserTeam was successfully deleted.' end - def delegate_projects - unless params[:project_ids].blank? - project_ids = params[:project_ids] - access = params[:greatest_project_access] - @team.assign_to_projects(project_ids, access) - end - - redirect_to admin_team_path(@team), notice: 'Projects was successfully added.' - end - - def relegate_project - project = params[:project_id] - @team.resign_from_project(project) - - redirect_to admin_team_path(@team), notice: 'Project was successfully removed.' - end - - def add_members - unless params[:user_ids].blank? - user_ids = params[:user_ids] - access = params[:default_project_access] - is_admin = params[:group_admin] - @team.add_members(user_ids, access, is_admin) - end - - redirect_to admin_team_path(@team), notice: 'Members was successfully added.' - end - - def remove_member - member = params[:member_id] - @team.remove_member(member) - - redirect_to admin_team_path(@team), notice: 'Member was successfully removed.' - end - private def user_team diff --git a/app/models/users_project.rb b/app/models/users_project.rb index d282b2ac..ca5048ca 100644 --- a/app/models/users_project.rb +++ b/app/models/users_project.rb @@ -41,7 +41,7 @@ class UsersProject < ActiveRecord::Base scope :masters, where(project_access: MASTER) scope :in_project, ->(project) { where(project_id: project.id) } - scope :in_projects, ->(projects) { where(project_id: projects.map(&:id)) } + scope :in_projects, ->(projects) { where(project_id: project_ids) } scope :with_user, ->(user) { where(user_id: user.id) } class << self diff --git a/config/routes.rb b/config/routes.rb index 3132c310..21bfc89c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -70,12 +70,6 @@ Gitlab::Application.routes.draw do end end resources :teams do #, constraints: { id: /[^\/]+/ } do end - member do - post :delegate_projects - delete :relegate_project - post :add_members - delete :remove_member - end scope module: :teams do resources :members, only: [:edit, :update, :destroy, :new, :create] resources :projects, only: [:edit, :update, :destroy, :new, :create]