From 94e2fa2ac32a88dfd802653f30f536c45845159b Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 22 Oct 2023 00:35:33 -0400 Subject: Quote stats should only consider published quotes --- app/controllers/quotes_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/quotes_controller.rb b/app/controllers/quotes_controller.rb index a0aa7cd..b6ddb6a 100644 --- a/app/controllers/quotes_controller.rb +++ b/app/controllers/quotes_controller.rb @@ -54,7 +54,7 @@ class QuotesController < ApplicationController year = i.months.ago.year beginning = i.months.ago.beginning_of_month.beginning_of_day endtime = i.months.ago.end_of_month.end_of_day - quotes = Quote.where("created_at >= :start_date AND created_at <= :end_date", { :start_date => beginning, :end_date => endtime }).all + quotes = Quote.published.where("created_at >= :start_date AND created_at <= :end_date", { :start_date => beginning, :end_date => endtime }).all @months[11-i] = { :name => Date::MONTHNAMES[month], :number => quotes.count } end @@ -102,7 +102,7 @@ class QuotesController < ApplicationController } person_count = {} - Quote.all.each do |quote| + Quote.published.each do |quote| person_in_quote = {} quote.content.split("\n").each do |line| -- cgit 1.4.1