Advertisement
mechnicov

Untitled

Apr 6th, 2022
1,304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.19 KB | None | 0 0
  1. Post.
  2.   includes(:comments, :user).
  3.   where(comments: { created_at: 1.hour.ago..Time.current }).
  4.   find_each do |post|
  5.     mail(to: post.user.email, subject: post.comments.pluck(:id).to_s)
  6.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement