diff options
-rw-r--r-- | app/helpers/issuables_helper.rb | 4 | ||||
-rw-r--r-- | changelogs/unreleased/fix_navigation_bar_issuables_counters.yml | 2 | ||||
-rw-r--r-- | spec/features/dashboard/issuables_counter_spec.rb | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb index 22311267860..58d46daa51e 100644 --- a/app/helpers/issuables_helper.rb +++ b/app/helpers/issuables_helper.rb @@ -142,7 +142,7 @@ module IssuablesHelper end def cached_assigned_issuables_count(assignee, issuable_type, state) - cache_key = "#{assignee.id}_#{issuable_type}_#{state}" + cache_key = hexdigest(['assigned_issuables_count', assignee.id, issuable_type, state].join('-')) Rails.cache.fetch(cache_key, expires_in: 2.minutes) do assigned_issuables_count(assignee, issuable_type, state) end @@ -151,7 +151,7 @@ module IssuablesHelper private def assigned_issuables_count(assignee, issuable_type, state) - assignee.send("assigned_#{issuable_type}").send(state).count + assignee.public_send("assigned_#{issuable_type}").public_send(state).count end def sidebar_gutter_collapsed? diff --git a/changelogs/unreleased/fix_navigation_bar_issuables_counters.yml b/changelogs/unreleased/fix_navigation_bar_issuables_counters.yml index c66f191a2d0..0f7f8155f91 100644 --- a/changelogs/unreleased/fix_navigation_bar_issuables_counters.yml +++ b/changelogs/unreleased/fix_navigation_bar_issuables_counters.yml @@ -1,4 +1,4 @@ --- title: Navigation bar issuables counters reflects dashboard issuables counters -merge_request: +merge_request: 7368 author: Lucas Deschamps diff --git a/spec/features/dashboard/issuables_counter_spec.rb b/spec/features/dashboard/issuables_counter_spec.rb index 699bc102790..f134eee19eb 100644 --- a/spec/features/dashboard/issuables_counter_spec.rb +++ b/spec/features/dashboard/issuables_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' describe 'Navigation bar counter', feature: true, js: true, caching: true do let(:user) { create(:user) } - let(:project) { create(:project, namespace: user.namespace) } + let(:project) { create(:empty_project, namespace: user.namespace) } before do login_as(user) |