Delete all notifications instead of destroying (#12577)
* Delete all notifications instead of destroying * Update spec to match new association
This commit is contained in:
parent
e1b1fe3ed7
commit
82b7f6519d
2 changed files with 2 additions and 2 deletions
|
|
@ -27,7 +27,7 @@ class Organization < ApplicationRecord
|
|||
has_many :credits, dependent: :restrict_with_error
|
||||
has_many :display_ads, dependent: :destroy
|
||||
has_many :listings, dependent: :destroy
|
||||
has_many :notifications, dependent: :destroy
|
||||
has_many :notifications, dependent: :delete_all
|
||||
has_many :organization_memberships, dependent: :delete_all
|
||||
has_many :profile_pins, as: :profile, inverse_of: :profile, dependent: :destroy
|
||||
has_many :sponsorships, dependent: :destroy
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ RSpec.describe Organization, type: :model do
|
|||
it { is_expected.to have_many(:credits).dependent(:restrict_with_error) }
|
||||
it { is_expected.to have_many(:display_ads).dependent(:destroy) }
|
||||
it { is_expected.to have_many(:listings).dependent(:destroy) }
|
||||
it { is_expected.to have_many(:notifications).dependent(:destroy) }
|
||||
it { is_expected.to have_many(:notifications).dependent(:delete_all) }
|
||||
it { is_expected.to have_many(:organization_memberships).dependent(:delete_all) }
|
||||
it { is_expected.to have_many(:profile_pins).dependent(:destroy) }
|
||||
it { is_expected.to have_many(:sponsorships).dependent(:destroy) }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue