Skip to content

Commit

Permalink
Fixes migration.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Frédéric de Villamil committed Aug 25, 2013
1 parent 72c1c7f commit 7dd91f1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions db/migrate/111_moves_statuses_to_notes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ class Profile < ActiveRecord::Base

serialize :profiles
end

class Content < ActiveRecord::Base
include BareMigration
end

class Status < Content
include BareMigration
Expand All @@ -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
Expand Down

0 comments on commit 7dd91f1

Please sign in to comment.