Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Example now uses find_each instead of find(:all).each #241

Closed
wants to merge 1 commit into from

2 participants

@mnaberez

Changed the example code output by the runner command to use find_each instead of find(:all).each.

@joshk

I think it might be better to use Product.all.each instead of find_each as this is only meant to be example code and not efficient production ready.

@mnaberez mnaberez closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 27, 2011
  1. @mnaberez
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  railties/lib/rails/commands/runner.rb
View
2  railties/lib/rails/commands/runner.rb
@@ -25,7 +25,7 @@
opts.separator "-------------------------------------------------------------"
opts.separator "#!/usr/bin/env #{File.expand_path($0)} runner"
opts.separator ""
- opts.separator "Product.find(:all).each { |p| p.price *= 2 ; p.save! }"
+ opts.separator "Product.find_each { |p| p.price *= 2 ; p.save! }"
opts.separator "-------------------------------------------------------------"
end
Something went wrong with that request. Please try again.