From 027d24d66a83dbd00273c3310e121090ade72097 Mon Sep 17 00:00:00 2001 From: f Date: Tue, 26 Apr 2022 16:55:54 -0300 Subject: [PATCH] memoizar el sitio --- app/controllers/stats_controller.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index 116bca7c..10b75819 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -97,8 +97,7 @@ class StatsController < ApplicationController end def authorize_stats - @site = find_site - authorize SiteStat.new(@site) + authorize SiteStat.new(site) end # TODO: Eliminar cuando mergeemos referer-origin @@ -195,4 +194,8 @@ class StatsController < ApplicationController p[:period_start]..p[:period_end] end end + + def site + @site ||= find_site + end end