From 1ba8a89d4998a4cf959718e1300e0a53a194b569 Mon Sep 17 00:00:00 2001 From: Oren Kanner Date: Wed, 20 Oct 2021 10:15:22 -0400 Subject: [PATCH] Disable brittle validation for IntegrationUsages Resolves LG-5273 This was causing our config seeders to fail due to an edge case where an integration was moved to a different account. --- app/models/agreements/integration_usage.rb | 4 +++- spec/models/agreements/integration_usage_spec.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/agreements/integration_usage.rb b/app/models/agreements/integration_usage.rb index 7ca5dc1ba4c..b2fd4cf4bff 100644 --- a/app/models/agreements/integration_usage.rb +++ b/app/models/agreements/integration_usage.rb @@ -12,7 +12,9 @@ class Agreements::IntegrationUsage < ApplicationRecord validates :integration, presence: true validates :integration_id, uniqueness: { scope: :iaa_order_id } - validate :integration_and_order_have_same_account + # DISABLED 2021-10-20 due to unforeseen edge case where we transfer an + # integration from one account to another + # validate :integration_and_order_have_same_account private diff --git a/spec/models/agreements/integration_usage_spec.rb b/spec/models/agreements/integration_usage_spec.rb index db3bc84580d..714f70e3c34 100644 --- a/spec/models/agreements/integration_usage_spec.rb +++ b/spec/models/agreements/integration_usage_spec.rb @@ -8,7 +8,7 @@ it { is_expected.to validate_presence_of(:integration) } it { is_expected.to validate_uniqueness_of(:integration_id).scoped_to(:iaa_order_id) } - it 'validates that the IAA Order and Integration belong to the same account' do + xit 'validates that the IAA Order and Integration belong to the same account' do subject.iaa_order = create(:iaa_order) expect(subject).not_to be_valid end