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.
This commit is contained in:
Robin Ward 2019-02-25 14:46:26 -05:00
parent 9bf11a7c02
commit 90c09d17b6
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ class IncomingLinksReport
end end
def self.per_user(start_date:, end_date:, category_id:) 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) .where('incoming_links.created_at > ? AND incoming_links.created_at < ? AND incoming_links.user_id IS NOT NULL', start_date, end_date)
.joins(:user) .joins(:user)
.group('users.username') .group('users.username')