configures act_as_commentable_with_threading gem [#7]

This commit is contained in:
rgarcia
2015-07-18 17:38:33 +02:00
parent 3ee102c0c5
commit 05705f3174
6 changed files with 68 additions and 2 deletions

View File

@@ -0,0 +1,21 @@
class ActsAsCommentableWithThreadingMigration < ActiveRecord::Migration
def self.up
create_table :comments, :force => true do |t|
t.integer :commentable_id
t.string :commentable_type
t.string :title
t.text :body
t.string :subject
t.integer :user_id, :null => false
t.integer :parent_id, :lft, :rgt
t.timestamps
end
add_index :comments, :user_id
add_index :comments, [:commentable_id, :commentable_type]
end
def self.down
drop_table :comments
end
end