diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-09-20 15:23:00 +0100 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-09-20 15:23:00 +0100 |
commit | ff7b545c8e462b909af92a5bea58de779c3f438b (patch) | |
tree | bdd6a8bc3c8527df2925288348c752eb87d1b9ea /lib/api/entities.rb | |
parent | 55a7529621515eaeffa1424a281e639cf74be6cf (diff) | |
parent | ff1deab6388dcb7f241205a1cd64eaddf1672753 (diff) | |
download | gitlab-ce-ff7b545c8e462b909af92a5bea58de779c3f438b.tar.gz |
Merge remote-tracking branch 'origin/master' into 18608-lock-issues
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 4b2ac1cce95..71d358907d1 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -244,7 +244,10 @@ module API end expose :merged do |repo_branch, options| - options[:project].repository.merged_to_root_ref?(repo_branch.name) + # n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/37442 + Gitlab::GitalyClient.allow_n_plus_1_calls do + options[:project].repository.merged_to_root_ref?(repo_branch.name) + end end expose :protected do |repo_branch, options| @@ -332,6 +335,7 @@ module API end class IssueBasic < ProjectEntity + expose :closed_at expose :labels do |issue, options| # Avoids an N+1 query since labels are preloaded issue.labels.map(&:title).sort |