From 7dd91f149aad0867cf4c0007930bbddb247c56ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20de=20Villamil?= Date: Sun, 25 Aug 2013 17:26:42 +0200 Subject: [PATCH] Fixes migration. For some reason I still don't understand, the first version of the migration would turn every content into a Status, which is not what's intended to. That one works. --- db/migrate/111_moves_statuses_to_notes.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/db/migrate/111_moves_statuses_to_notes.rb b/db/migrate/111_moves_statuses_to_notes.rb index 9b5259aa2e..867afcad1c 100644 --- a/db/migrate/111_moves_statuses_to_notes.rb +++ b/db/migrate/111_moves_statuses_to_notes.rb @@ -4,6 +4,10 @@ class Profile < ActiveRecord::Base serialize :profiles end + + class Content < ActiveRecord::Base + include BareMigration + end class Status < Content include BareMigration @@ -19,6 +23,7 @@ def self.up statuses = Content.where("type = ?", "Status") statuses.each do |status| + say "#{status.id} #{status.type}" status.type = "Note" status.save end