public
Description: An implementation of polymorphic association for Ruby on Rails
Homepage:
Clone URL: git://github.com/ducduong/polymorphic_association.git
polymorphic_association / migrate / 20080706212038_create_associations.rb
100644 13 lines (11 sloc) 0.27 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
class CreateAssociations < ActiveRecord::Migration
  def self.up
    create_table :associations do |t|
      t.references :first, :polymorphic => true
      t.references :second, :polymorphic => true
    end
  end
 
  def self.down
    drop_table :associations
  end
end