Reload columns before rendering notes during migration

Fixes #1351
This commit is contained in:
Dan Rice 2012-12-04 18:44:58 -05:00
parent 109da4f213
commit 1de6a0c9dc

View file

@ -2,6 +2,8 @@ class AddRenderedNotes < ActiveRecord::Migration
def self.up
add_column :todos, 'rendered_notes', :text
Todo.reset_column_information
puts "-- Clearing show_from dates from completed todos"
# clear up completed todos that have show_from set. These could have been left over from before the AASM migration
Todo.completed.find(:all, :conditions =>[ "NOT(show_from IS NULL)"]).each {|t| t.show_from=nil; t.save!}