guoren/app/models/micro_post.rb

5 lines
154 B
Ruby
Raw Permalink Normal View History

2016-12-22 20:05:38 +08:00
class MicroPost < ApplicationRecord
2016-12-27 17:45:57 +08:00
belongs_to :user
2016-12-22 20:05:38 +08:00
has_many :comments, class_name: 'Comment', foreign_key: 'micro_post_id', dependent: :destroy
end