Commit e263e9f5 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'fix-memoization-in-contributions-calendar' into 'master'

Fix memoization in ContributionsCalendar#activity_dates

See merge request !11973
parents 6d01535e ed6f6cf2
Pipeline #8841627 failed with stages
in 77 minutes and 6 seconds
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment