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:
Javi Martín
2019-10-24 03:50:58 +02:00
parent 915e2792fc
commit 94d2496f8f
13 changed files with 55 additions and 12 deletions

View File

@@ -20,7 +20,7 @@ class Legislation::Proposal < ApplicationRecord
acts_as_paranoid column: :hidden_at
belongs_to :process, foreign_key: "legislation_process_id"
belongs_to :author, -> { with_hidden }, class_name: "User"
belongs_to :author, -> { with_hidden }, class_name: "User", inverse_of: :legislation_proposals
belongs_to :geozone
has_many :comments, as: :commentable