Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # comments migration
- class CreateComments < ActiveRecord::Migration
- def change
- create_table :comments do |t|
- t.text :text
- t.integer :user_id
- t.integer :commentable_id
- t.string :commentable_type
- t.timestamps
- end
- add_index :comments, [:commentable_type, :commentable_id]
- end
- end
- # comment model
- module ActivityFusion
- class Comment < ActiveRecord::Base
- belongs_to :commentable, polymorphic: true
- end
- end
Add Comment
Please, Sign In to add comment