From cfce177d000937ddd08f4ee1270b327b385fbb0c Mon Sep 17 00:00:00 2001 From: Luiz Picolo Date: Fri, 8 Oct 2021 21:54:36 -0400 Subject: [PATCH] Changed return to current day --- models/rate.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/rate.rb b/models/rate.rb index bc482f8..1cdf4b7 100644 --- a/models/rate.rb +++ b/models/rate.rb @@ -6,11 +6,11 @@ ActiveRecord::Base.default_timezone = :local class Rate < ActiveRecord::Base def self.get_download - all.collect { |p| [p.created_at.strftime('%d/%m %H:%M'), p.download] } + where(created_at: Date.today.all_day).collect { |p| [p.created_at.strftime('%d/%m %H:%M'), p.download] } end def self.get_upload - all.collect { |p| [p.created_at.strftime('%d/%m %H:%M'), p.upload] } + where(created_at: Date.today.all_day).collect { |p| [p.created_at.strftime('%d/%m %H:%M'), p.upload] } end def self.save