Remove unnecessary foreign_key options
When we specify `belongs_to :author`, ActiveRecord automatically uses `author_id` as the foreign key.
This commit is contained in:
@@ -5,7 +5,7 @@ class RelatedContent < ApplicationRecord
|
||||
acts_as_paranoid column: :hidden_at
|
||||
include ActsAsParanoidAliases
|
||||
|
||||
belongs_to :author, class_name: "User", foreign_key: "author_id"
|
||||
belongs_to :author, class_name: "User"
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user