From ed6f6cf2fc627ca9f1b0e8aa1ed6a9f7e6d2d3ab Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Wed, 7 Jun 2017 14:29:49 +0100 Subject: Fix memoization in ContributionsCalendar#activity_dates This doesn't appear to be actually called twice, but having it appear to work but not would be a problem if it was. --- lib/gitlab/contributions_calendar.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gitlab/contributions_calendar.rb b/lib/gitlab/contributions_calendar.rb index 15992b77680..060e013183f 100644 --- a/lib/gitlab/contributions_calendar.rb +++ b/lib/gitlab/contributions_calendar.rb @@ -28,7 +28,7 @@ module Gitlab union = Gitlab::SQL::Union.new([repo_events, issue_events, mr_events, note_events]) events = Event.find_by_sql(union.to_sql).map(&:attributes) - @activity_events = events.each_with_object(Hash.new {|h, k| h[k] = 0 }) do |event, activities| + @activity_dates = events.each_with_object(Hash.new {|h, k| h[k] = 0 }) do |event, activities| activities[event["date"]] += event["total_amount"] end end -- cgit v1.2.1