From ba7ba359b4862b82c02761259361e48d7dfde83d Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 27 Jan 2024 13:03:45 +0100 Subject: [PATCH] Rename user/question associations to `:inbox_entries` --- app/models/question.rb | 2 +- app/models/user.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/question.rb b/app/models/question.rb index 85d24ad1..2c289a88 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -4,7 +4,7 @@ class Question < ApplicationRecord belongs_to :user, optional: true has_many :anonymous_blocks, dependent: :nullify has_many :answers, dependent: :destroy - has_many :inboxes, dependent: :destroy + has_many :inbox_entries, dependent: :destroy validates :content, length: { minimum: 1 } diff --git a/app/models/user.rb b/app/models/user.rb index d6aa0f85..50a88d2b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -33,7 +33,7 @@ class User < ApplicationRecord has_many :questions, dependent: :destroy_async has_many :answers, dependent: :destroy_async has_many :comments, dependent: :destroy_async - has_many :inboxes, dependent: :destroy_async + has_many :inbox_entries, dependent: :destroy_async has_many :smiles, class_name: "Reaction", dependent: :destroy_async has_many :notifications, foreign_key: :recipient_id, dependent: :destroy_async has_many :reports, dependent: :destroy_async