namespace :thoughts do desc "Email a review of the last day's upvotes" task :email_upvote_report => :environment do votes = Vote.where("created_at > ?", 1.day.ago).where(upvote: 1).all unless votes.empty? VoteMailer.with(votes: votes).daily_report_email.deliver end end end