diff options
author | Sean McGivern <sean@gitlab.com> | 2018-04-02 16:14:20 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-04-05 13:59:05 +0100 |
commit | e7b1d201dd56611eff7e796e9a390a7b21df51d1 (patch) | |
tree | 77918cabd27f31980c5f2d49d4fcd562682688b3 /app/policies/issue_policy.rb | |
parent | 8dca091ff7f04bb92a7835ebeff783b7f0ef76cd (diff) | |
download | gitlab-ce-e7b1d201dd56611eff7e796e9a390a7b21df51d1.tar.gz |
Fix N+1 in MergeRequestParser
read_project can be prevented by a very expensive condition, which we want to
avoid, while still not writing manual SQL queries. read_project_for_iids is used
by read_issue_iid and read_merge_request_iid to satisfy both of those
constraints, and allow the declarative policy runner to use its normal caching
strategy.
Diffstat (limited to 'app/policies/issue_policy.rb')
-rw-r--r-- | app/policies/issue_policy.rb | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/app/policies/issue_policy.rb b/app/policies/issue_policy.rb index ed499511999..263c6e3039c 100644 --- a/app/policies/issue_policy.rb +++ b/app/policies/issue_policy.rb @@ -17,6 +17,4 @@ class IssuePolicy < IssuablePolicy prevent :update_issue prevent :admin_issue end - - rule { can?(:read_issue) | visible_to_user }.enable :read_issue_iid end |