I think this fixes the migration. Let me know if your done status is converted properly or not.

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@328 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2006-10-16 04:33:15 +00:00
parent f67e36871c
commit 77bb3f556c

View file

@ -7,7 +7,7 @@ class ConvertProjectToStateMachine < ActiveRecord::Migration
add_column :projects, :state, :string, :limit => 20, :default => "active", :null => false
@projects = Project.find(:all)
@projects.each do |project|
project.state = project.done ? 'completed' : 'active'
project.state = project.done? ? 'completed' : 'active'
project.save
end
remove_column :projects, :done