From 2f76ff19f8f520a584a1259bd0c779e988cd7360 Mon Sep 17 00:00:00 2001 From: Heinrich Lee Yu Date: Fri, 11 Jan 2019 22:58:18 +0800 Subject: Fix MilestonesFinder to pass relations to scope Instead of querying relations into ids we just pass them to the model scope because the scope supports it now. Also changes other calls to `Milestone.for_projects_and_groups` --- app/services/milestones/promote_service.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'app/services/milestones') diff --git a/app/services/milestones/promote_service.rb b/app/services/milestones/promote_service.rb index 39071b5dc14..cbe5996e8ca 100644 --- a/app/services/milestones/promote_service.rb +++ b/app/services/milestones/promote_service.rb @@ -82,11 +82,9 @@ module Milestones end # rubocop: enable CodeReuse/ActiveRecord - # rubocop: disable CodeReuse/ActiveRecord def group_project_ids - @group_project_ids ||= group.projects.pluck(:id) + group.projects.select(:id) end - # rubocop: enable CodeReuse/ActiveRecord def raise_error(message) raise PromoteMilestoneError, "Promotion failed - #{message}" -- cgit v1.2.1