diff options
author | Sean McGivern <sean@gitlab.com> | 2017-07-11 19:12:33 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-07-19 12:21:20 +0300 |
commit | 0e488ef70ab2608847423201e957693745f1e3b1 (patch) | |
tree | 1b7a329505c1a3026a777258040a3f5be9870561 /app/finders/issues_finder.rb | |
parent | b3a588bccaaa078a81e8ce322d75ee167f642e13 (diff) |
Clear issuable counter caches on update
When an issuable's state changes, or one is created, we should clear the cache
counts for a user's assigned issuables, and also the project-wide caches for
this user type.
Diffstat (limited to 'app/finders/issues_finder.rb')
-rw-r--r-- | app/finders/issues_finder.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/finders/issues_finder.rb b/app/finders/issues_finder.rb index 295a64ef5b8..0ec42a4e6eb 100644 --- a/app/finders/issues_finder.rb +++ b/app/finders/issues_finder.rb @@ -84,6 +84,16 @@ class IssuesFinder < IssuableFinder super + extra_components end + def state_counter_cache_key_components_permutations + # Ignore the last two, as we'll provide both options for them. + components = super.first[0..-3] + + [ + components + [false, true], + components + [true, false] + ] + end + def by_assignee(items) if assignee items.assigned_to(assignee) |