guoren/app/models/comment.rb

4 lines
180 B
Ruby
Raw Normal View History

2016-12-22 20:05:38 +08:00
class Comment < ApplicationRecord
belongs_to :user, class_name: 'User', foreign_key: 'user_id'
belongs_to :micro_post, class_name: 'MicroPost', foreign_key: 'micro_post_id'
end