Add author user to related content

This commit is contained in:
Bertocq
2017-12-20 02:05:01 +01:00
parent 4d2d7c1a0a
commit 2688f2a919
3 changed files with 8 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ class RelatedContent < ActiveRecord::Base
acts_as_paranoid column: :hidden_at
include ActsAsParanoidAliases
belongs_to :author, class_name: 'User', foreign_key: 'author_id'
belongs_to :parent_relationable, polymorphic: true, touch: true
belongs_to :child_relationable, polymorphic: true, touch: true
has_one :opposite_related_content, class_name: 'RelatedContent', foreign_key: :related_content_id