7646e982d3
- creator polymorphic instead of user - implementation
18 lines
505 B
Ruby
18 lines
505 B
Ruby
class CreateComments < ActiveRecord::Migration
|
|
def self.up
|
|
create_table :comments do |t|
|
|
t.string :title, :limit => 50, :default => ""
|
|
t.text :comment
|
|
t.references :commentable, :polymorphic => true, :index => true
|
|
t.references :creator, :polymorphic => true, :index => true
|
|
t.string :role, :default => "comments", :index => true
|
|
t.timestamps
|
|
end
|
|
|
|
end
|
|
|
|
def self.down
|
|
drop_table :comments
|
|
end
|
|
end
|