From f2d932268d1b30929e45d7503ef90b325a85e314 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 24 Jun 2019 10:48:50 -0700 Subject: Rename Todos.with_api_entity_associations to with_entity_associations Since this scope is used in both the controller and the API, we rename it to make it clear that it's used for both. --- app/models/todo.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/todo.rb') diff --git a/app/models/todo.rb b/app/models/todo.rb index f1fc5e599eb..240c91da5b6 100644 --- a/app/models/todo.rb +++ b/app/models/todo.rb @@ -60,7 +60,7 @@ class Todo < ApplicationRecord scope :for_type, -> (type) { where(target_type: type) } scope :for_target, -> (id) { where(target_id: id) } scope :for_commit, -> (id) { where(commit_id: id) } - scope :with_api_entity_associations, -> { preload(:target, :author, :note, group: :route, project: [:route, { namespace: :route }]) } + scope :with_entity_associations, -> { preload(:target, :author, :note, group: :route, project: [:route, { namespace: :route }]) } scope :joins_issue_and_assignees, -> { left_joins(issue: :assignees) } state_machine :state, initial: :pending do -- cgit v1.2.1