Skip to content

Commit

Permalink
Fix AccreditingProviderEnrichment to be Rails 8-compatible.
Browse files Browse the repository at this point in the history
Rails 8 added a new attribute that AccreditingProviderEnrichment now needs to ignore
context_for_validation.
  • Loading branch information
gms-gs committed Dec 2, 2024
1 parent 1f6a49f commit 98ddd5a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions app/models/accrediting_provider_enrichment.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
# frozen_string_literal: true

class AccreditingProviderEnrichment
include ActiveModel::Validations
include ActiveModel::Model

# Pascal cased as the original is stored like so.
attr_accessor :UcasProviderCode, :Description

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.except('errors', 'context_for_validation'))
end

class ArraySerializer
Expand Down

0 comments on commit 98ddd5a

Please sign in to comment.