diff options
author | Sean McGivern <sean@gitlab.com> | 2017-06-07 16:29:49 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-06-07 16:29:49 +0300 |
commit | ed6f6cf2fc627ca9f1b0e8aa1ed6a9f7e6d2d3ab (patch) | |
tree | 7d6e9b4f912e4c5e9bab8740eaaa105a5b017864 /lib/gitlab/contributions_calendar.rb | |
parent | de12e4e2049aea365bdd668a9b96240321e6d755 (diff) |
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.
Diffstat (limited to 'lib/gitlab/contributions_calendar.rb')
-rw-r--r-- | lib/gitlab/contributions_calendar.rb | 2 |
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 |