Rename `Inbox` model to `InboxEntry`
This commit is contained in:
parent
e754d6f174
commit
af9cbcdb11
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Inbox < ApplicationRecord
|
||||
class InboxEntry < ApplicationRecord
|
||||
belongs_to :user, touch: :inbox_updated_at
|
||||
belongs_to :question
|
||||
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue