Sha256: 1bc6ed9356793ab259b38212d070a9fbed21b75c5dd36eac9da8cfd880051bc8
Contents?: true
Size: 704 Bytes
Versions: 12
Compression:
Stored size: 704 Bytes
Contents
class ActsAsTaggableOnMigration < ActiveRecord::Migration def self.up create_table :tags do |t| t.column :name, :string end create_table :taggings do |t| t.integer :tag_id t.integer :taggable_id t.integer :tagger_id t.string :tagger_type # You should make sure that the column created is # long enough to store the required class names. t.string :taggable_type, :limit => 50 t.string :context, :limit => 50 t.column :created_at, :datetime end add_index :taggings, :tag_id add_index :taggings, [:taggable_id, :taggable_type, :context] end def self.down drop_table :taggings drop_table :tags end end
Version data entries
12 entries across 12 versions & 1 rubygems