Created
January 21, 2012 18:49
-
-
Save jweir/1653569 to your computer and use it in GitHub Desktop.
Migrate from ActsAsTaggableOnSteroids to ActsAsTaggableOn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MigrateTaggings < ActiveRecord::Migration | |
def up | |
change_table :taggings do |t| | |
t.references :tagger, :polymorphic => true | |
t.string :context, :limit => 128 | |
t.index [:taggable_id, :taggable_type, :context] | |
end | |
ActsAsTaggableOn::Tagging.all.each {|t| t.update_attribute :context, 'tags'} | |
end | |
def down | |
end | |
end |
Thank you very much!
Thank you! You saved me :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Seeing Unknown column 'taggings.context'...?
Are you are upgrading to the acts-as-taggable-on gem?
You might be missing some database fields. This migration will take care of that.