Skip to content

Instantly share code, notes, and snippets.

@jweir
Created January 21, 2012 18:49
Show Gist options
  • Save jweir/1653569 to your computer and use it in GitHub Desktop.
Save jweir/1653569 to your computer and use it in GitHub Desktop.
Migrate from ActsAsTaggableOnSteroids to ActsAsTaggableOn
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
@taniarv
Copy link

taniarv commented Mar 11, 2014

Thank you! You saved me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment