Skip to content

Instantly share code, notes, and snippets.

@SpringMT
Created April 26, 2014 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SpringMT/11317662 to your computer and use it in GitHub Desktop.
Save SpringMT/11317662 to your computer and use it in GitHub Desktop.
diff --git a/db/migrate/20140426112747_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb b/db/migrate/20140426112747_acts_as_taggable_on_migratio
n.acts_as_taggable_on_engine.rb
index 6bbd559..9d9df73 100644
--- a/db/migrate/20140426112747_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb
+++ b/db/migrate/20140426112747_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb
@@ -2,7 +2,7 @@
class ActsAsTaggableOnMigration < ActiveRecord::Migration
def self.up
create_table :tags do |t|
- t.string :name
+ t.string :name, limit: 191
end
create_table :taggings do |t|
@@ -10,8 +10,8 @@ class ActsAsTaggableOnMigration < ActiveRecord::Migration
# You should make sure that the column created is
# long enough to store the required class names.
- t.references :taggable, polymorphic: true
- t.references :tagger, polymorphic: true
+ t.references :taggable, polymorphic: {limit: 191}
+ t.references :tagger, polymorphic: {limit: 191}
# Limit is created to prevent MySQL error on index
# length for MyISAM table type: http://bit.ly/vgW2Ql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment