Skip to content

Instantly share code, notes, and snippets.

@dejan
dejan / gist:74643
Created March 5, 2009 23:29
(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 } }
class String
#
# http://rors.org/2008/7/09/alternative-join-and-split-in-ruby
#
alias / :split
end