diff --git a/app/models/inbox.rb b/app/models/inbox_entry.rb similarity index 97% rename from app/models/inbox.rb rename to app/models/inbox_entry.rb index 96f3dc84..d03fa6e7 100644 --- a/app/models/inbox.rb +++ b/app/models/inbox_entry.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class Inbox < ApplicationRecord +class InboxEntry < ApplicationRecord belongs_to :user, touch: :inbox_updated_at belongs_to :question diff --git a/spec/factories/inbox.rb b/spec/factories/inbox_entry.rb similarity index 82% rename from spec/factories/inbox.rb rename to spec/factories/inbox_entry.rb index 6345fa72..182e69c2 100644 --- a/spec/factories/inbox.rb +++ b/spec/factories/inbox_entry.rb @@ -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 diff --git a/spec/models/inbox_spec.rb b/spec/models/inbox_entry_spec.rb similarity index 88% rename from spec/models/inbox_spec.rb rename to spec/models/inbox_entry_spec.rb index 9a00635a..55092648 100644 --- a/spec/models/inbox_spec.rb +++ b/spec/models/inbox_entry_spec.rb @@ -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