From 90c09d17b6e75b6742a6994bd12d1973d31112f2 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 25 Feb 2019 14:46:26 -0500 Subject: [PATCH] FIX: Heisentest - don't memoize on a class variable Repeated usage of the same class will have the same memoized results even if the data has changed. --- app/models/incoming_links_report.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/incoming_links_report.rb b/app/models/incoming_links_report.rb index 541185e87ab..3ff1d54d517 100644 --- a/app/models/incoming_links_report.rb +++ b/app/models/incoming_links_report.rb @@ -69,7 +69,7 @@ class IncomingLinksReport end def self.per_user(start_date:, end_date:, category_id:) - @per_user_query ||= public_incoming_links(category_id: category_id) + public_incoming_links(category_id: category_id) .where('incoming_links.created_at > ? AND incoming_links.created_at < ? AND incoming_links.user_id IS NOT NULL', start_date, end_date) .joins(:user) .group('users.username')