summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-06-07 14:29:49 +0100
committerSean McGivern <sean@gitlab.com>2017-06-07 14:29:49 +0100
commited6f6cf2fc627ca9f1b0e8aa1ed6a9f7e6d2d3ab (patch)
tree7d6e9b4f912e4c5e9bab8740eaaa105a5b017864
parentde12e4e2049aea365bdd668a9b96240321e6d755 (diff)
downloadgitlab-ce-fix-memoization-in-contributions-calendar.tar.gz
Fix memoization in ContributionsCalendar#activity_datesfix-memoization-in-contributions-calendar
This doesn't appear to be actually called twice, but having it appear to work but not would be a problem if it was.
-rw-r--r--lib/gitlab/contributions_calendar.rb2
1 files changed, 1 insertions, 1 deletions
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