Open ryohakjae114 opened 3 weeks ago
[x] 調査 15:20~
Post.select('posts.*', 'count(likes.id) AS likes').left_joins(:likes).group('posts.id').order('likes DESC')
Post.select('posts.*', 'count(likes.id) AS likes').left_joins(:likes).where(likes: {created_at: yesterday_range}).group('posts.id').order('likes DESC').limit(10)
[x] タスク 5m 5m, 15:33~15:48
[x] 調査、タスクばらし 17:48~
spec/lib/tasks/send_mail_spec
[x] タスクばらし
[x] rake_helperファイルの作成
require 'rake'
RSpec.configure do |config|
config.before(:suite) do
Rails.application.load_tasks # Load all the tasks just as Rails does (`load 'Rakefile'` is another simple way)
end
config.before(:each) do Rake.application.tasks.each(&:reenable) # Remove persistency between examples end end
require 'rake_helper'
subject(:task) { Rake.application['**:**'] }
task.invoke
・毎朝7時に前日の「いいね」数ランキングが10位までの投稿がメール通知されるようにする ・メール内に投稿内容も記載されるようにする ・メールはHTMLメールである程度見栄えがデザインされたものであること ・スクリプトはRakeタスク化すること ・Postのモデルクラスを作成する ・https://qiita.com/aeroastro/items/c97bd26ce8b8818b6bed ・全ユーザのテストはheartinにもあるのでそれを参考に