diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-22 00:35:33 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-22 00:35:33 -0400 |
commit | 94e2fa2ac32a88dfd802653f30f536c45845159b (patch) | |
tree | eaeebef389a542d12c51bfa050df8b0f8d160a23 /app/controllers | |
parent | 4ecc5d37609c3de8d3b013a738f3704f1e70c61a (diff) | |
download | thoughts-94e2fa2ac32a88dfd802653f30f536c45845159b.tar.gz thoughts-94e2fa2ac32a88dfd802653f30f536c45845159b.tar.bz2 thoughts-94e2fa2ac32a88dfd802653f30f536c45845159b.zip |
Quote stats should only consider published quotes
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/quotes_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 | |||
54 | year = i.months.ago.year | 54 | year = i.months.ago.year |
55 | beginning = i.months.ago.beginning_of_month.beginning_of_day | 55 | beginning = i.months.ago.beginning_of_month.beginning_of_day |
56 | endtime = i.months.ago.end_of_month.end_of_day | 56 | endtime = i.months.ago.end_of_month.end_of_day |
57 | quotes = Quote.where("created_at >= :start_date AND created_at <= :end_date", { :start_date => beginning, :end_date => endtime }).all | 57 | quotes = Quote.published.where("created_at >= :start_date AND created_at <= :end_date", { :start_date => beginning, :end_date => endtime }).all |
58 | @months[11-i] = { :name => Date::MONTHNAMES[month], :number => quotes.count } | 58 | @months[11-i] = { :name => Date::MONTHNAMES[month], :number => quotes.count } |
59 | end | 59 | end |
60 | 60 | ||
@@ -102,7 +102,7 @@ class QuotesController < ApplicationController | |||
102 | } | 102 | } |
103 | 103 | ||
104 | person_count = {} | 104 | person_count = {} |
105 | Quote.all.each do |quote| | 105 | Quote.published.each do |quote| |
106 | person_in_quote = {} | 106 | person_in_quote = {} |
107 | 107 | ||
108 | quote.content.split("\n").each do |line| | 108 | quote.content.split("\n").each do |line| |