Skip to content
Browse files

[ci skip] Doc ability to chain in `find_each`

Also use appropriate mailer syntax in the `find_each` block.
  • Loading branch information...
1 parent 63f4155 commit f7e4362011ceb1317fd401125d48d7ccb9a1079c @schneems schneems committed Jun 28, 2014
Showing with 9 additions and 1 deletion.
  1. +9 −1 guides/source/
10 guides/source/
@@ -309,7 +309,15 @@ The `find_each` method retrieves a batch of records and then yields _each_ recor
User.find_each do |user|
- NewsLetter.weekly_deliver(user)
+ NewsMailer.weekly(user).deliver
+To add conditions to a `find_each` operation you can chain other Active Record methods such as `where`:
+User.where(weekly_subscriber: true).find_each do |user|
+ NewsMailer.weekly(user).deliver

0 comments on commit f7e4362

Please sign in to comment.
Something went wrong with that request. Please try again.