Skip to content

Instantly share code, notes, and snippets.

@dejan
Created March 5, 2009 23:29
Show Gist options
  • Save dejan/74643 to your computer and use it in GitHub Desktop.
Save dejan/74643 to your computer and use it in GitHub Desktop.
(rails 2.3 feature) batch updating all definitions
Definition.find_in_batches { |group| group.each { |item| item.save } }
Video.find_in_batches { |group| group.each { |item| item.save } }
AttachedImage.find_in_batches(:conditions => 'parent_id is null') { |group| group.each { |item| item.save } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment