From c2b0ca10c893b436ca249729debece2c307dd9ab Mon Sep 17 00:00:00 2001 From: gms-gs Date: Mon, 2 Dec 2024 14:14:07 +0000 Subject: [PATCH] Fix AccreditingProviderEnrichment to be Rails 8-compatible. Rails 8 added a new attribute that AccreditingProviderEnrichment now needs to ignore context_for_validation. --- app/models/accrediting_provider_enrichment.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/models/accrediting_provider_enrichment.rb b/app/models/accrediting_provider_enrichment.rb index 4962e4b6bb..94eccb9601 100644 --- a/app/models/accrediting_provider_enrichment.rb +++ b/app/models/accrediting_provider_enrichment.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true class AccreditingProviderEnrichment - include ActiveModel::Validations include ActiveModel::Model # Pascal cased as the original is stored like so. @@ -9,10 +8,8 @@ class AccreditingProviderEnrichment validates :Description, words_count: { maximum: 100 } - def initialize(attrs) - attrs.each do |attr, value| - send("#{attr}=", value) unless attr == 'errors' - end + def initialize(attributes = {}) + super(attributes.slice('UcasProviderCode', 'Description')) end class ArraySerializer