fixed AddRenderedNotes migration on Rails > 3.1

This commit is contained in:
Michael Witrant 2012-07-07 10:27:59 +02:00
parent bd8498f39c
commit 6fd369b91e

View file

@ -9,7 +9,11 @@ class AddRenderedNotes < ActiveRecord::Migration
# Call save! on each todo to force generation of rendered_todos
i=0; max = Todo.all.count; start = Time.now
Todo.all.each do |todo|
todo.save(false)
if Rails.version < '3.0'
todo.save(false)
else
todo.save(:validate => false)
end
i = i + 1
if i%250==0
elapsed_sec = (Time.now-start)