Move directory with project. Fixed all related path methods to use namespace
This commit is contained in:
parent
e29ccece33
commit
71214bee75
9 changed files with 55 additions and 10 deletions
|
@ -48,14 +48,18 @@ class Admin::GroupsController < AdminController
|
|||
|
||||
def project_update
|
||||
project_ids = params[:project_ids]
|
||||
Project.where(id: project_ids).update_all(group_id: @group.id)
|
||||
|
||||
Project.where(id: project_ids).each do |project|
|
||||
project.namespace_id = @group.id
|
||||
project.save
|
||||
end
|
||||
|
||||
redirect_to :back, notice: 'Group was successfully updated.'
|
||||
end
|
||||
|
||||
def remove_project
|
||||
@project = Project.find(params[:project_id])
|
||||
@project.group_id = nil
|
||||
@project.namespace_id = nil
|
||||
@project.save
|
||||
|
||||
redirect_to :back, notice: 'Group was successfully updated.'
|
||||
|
|
|
@ -4,7 +4,7 @@ class DashboardController < ApplicationController
|
|||
before_filter :event_filter, only: :index
|
||||
|
||||
def index
|
||||
@groups = Group.where(id: current_user.projects.pluck(:group_id))
|
||||
@groups = Group.where(id: current_user.projects.pluck(:namespace_id))
|
||||
@projects = current_user.projects_sorted_by_activity
|
||||
@projects = @projects.page(params[:page]).per(30)
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ class GroupsController < ApplicationController
|
|||
end
|
||||
|
||||
def projects
|
||||
@projects ||= current_user.projects_sorted_by_activity.where(group_id: @group.id)
|
||||
@projects ||= current_user.projects_sorted_by_activity.where(namespace_id: @group.id)
|
||||
end
|
||||
|
||||
def project_ids
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue