about summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-12-07 10:33:07 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-12-07 10:33:07 -0500
commit9681897e9ace534c4559fa9be20aa86af1a42e13 (patch)
tree85fbe155f6d1db7f8e232dac40be109fa066f9ed /lib
parentde217df62df5725450ba7fd0084a00a8ebe24599 (diff)
downloadthoughts-9681897e9ace534c4559fa9be20aa86af1a42e13.tar.gz
thoughts-9681897e9ace534c4559fa9be20aa86af1a42e13.tar.bz2
thoughts-9681897e9ace534c4559fa9be20aa86af1a42e13.zip
Add daily upvote email like AO3 kudos
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/tasks.rake10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/tasks/tasks.rake b/lib/tasks/tasks.rake new file mode 100644 index 0000000..fee22f4 --- /dev/null +++ b/lib/tasks/tasks.rake
@@ -0,0 +1,10 @@
1namespace :thoughts do
2 desc "Email a review of the last day's upvotes"
3 task :email_upvote_report => :environment do
4 votes = Vote.where("created_at > ?", 1.day.ago).where(upvote: 1).all
5
6 unless votes.empty?
7 VoteMailer.with(votes: votes).daily_report_email.deliver
8 end
9 end
10end