Add missing has_many relations for users
Usually when we specify a `belongs_to` relations, we also specify its equivalent `has_many`. That allows us to write, for example: `topic.user.topics`.
This commit is contained in:
@@ -9,7 +9,7 @@ class Poll::Question < ApplicationRecord
|
||||
include Globalizable
|
||||
|
||||
belongs_to :poll
|
||||
belongs_to :author, -> { with_hidden }, class_name: "User"
|
||||
belongs_to :author, -> { with_hidden }, class_name: "User", inverse_of: :poll_questions
|
||||
|
||||
has_many :comments, as: :commentable
|
||||
has_many :answers, class_name: "Poll::Answer"
|
||||
|
||||
Reference in New Issue
Block a user