From 50c1a989cc9c756c343e1f169474e35c3850bbc1 Mon Sep 17 00:00:00 2001 From: Jan Provaznik Date: Fri, 29 Jun 2018 16:08:18 +0200 Subject: [PATCH] More EE->CE fixes --- app/controllers/concerns/todos_actions.rb | 1 - app/controllers/projects/todos_controller.rb | 1 + app/helpers/todos_helper.rb | 4 +--- app/models/todo.rb | 2 +- app/services/todo_service.rb | 1 - 5 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/controllers/concerns/todos_actions.rb b/app/controllers/concerns/todos_actions.rb index 7e5a12a11f4..c0acdb3498d 100644 --- a/app/controllers/concerns/todos_actions.rb +++ b/app/controllers/concerns/todos_actions.rb @@ -1,5 +1,4 @@ module TodosActions - include Gitlab::Utils::StrongMemoize extend ActiveSupport::Concern def create diff --git a/app/controllers/projects/todos_controller.rb b/app/controllers/projects/todos_controller.rb index 248fb8a4381..93fb9da6510 100644 --- a/app/controllers/projects/todos_controller.rb +++ b/app/controllers/projects/todos_controller.rb @@ -1,4 +1,5 @@ class Projects::TodosController < Projects::ApplicationController + include Gitlab::Utils::StrongMemoize include TodosActions before_action :authenticate_user!, only: [:create] diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 2a097f1a0d3..7cd74358168 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -169,9 +169,7 @@ module TodosHelper end def todo_group_options - groups = current_user.authorized_groups - - groups = groups.map do |group| + groups = current_user.authorized_groups.map do |group| { id: group.id, text: group.full_name } end diff --git a/app/models/todo.rb b/app/models/todo.rb index 61158285ea9..942cbb754e3 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -83,7 +83,7 @@ class Todo < ActiveRecord::Base end def parent - project || group + project end def unmergeable? diff --git a/app/services/todo_service.rb b/app/services/todo_service.rb index 5a2460a0cf5..4a7e89a63c7 100644 --- a/app/services/todo_service.rb +++ b/app/services/todo_service.rb @@ -285,7 +285,6 @@ class TodoService def attributes_for_target(target) attributes = { project_id: target&.project&.id, - group_id: target.respond_to?(:group) ? target.group_id : nil, target_id: target.id, target_type: target.class.name, commit_id: nil