Rename `Inbox` model to `InboxEntry`

This commit is contained in:
Andreas Nedbal 2024-01-27 12:57:09 +01:00 committed by Andreas Nedbal
parent e754d6f174
commit af9cbcdb11
3 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
class Inbox < ApplicationRecord
class InboxEntry < ApplicationRecord
belongs_to :user, touch: :inbox_updated_at
belongs_to :question

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
FactoryBot.define do
factory :inbox do
factory :inbox_entry do
question { FactoryBot.build(:question) }
new { true }
end

View File

@ -2,7 +2,7 @@
require "rails_helper"
describe Inbox, type: :model do
describe InboxEntry, type: :model do
describe "associations" do
it { should belong_to(:user) }
it { should belong_to(:question) }
@ -13,7 +13,7 @@ describe Inbox, type: :model do
let(:question) { FactoryBot.create(:question, author_is_anonymous: true) }
it "does not fail if the user wants to delete their account" do
Inbox.create(user:, question:)
InboxEntry.create(user:, question:)
# this deletes the User record and enqueues the deletion of all
# associated records in sidekiq