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 84c05a5 commit c2b0ca1
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.slice('UcasProviderCode', 'Description'))
end

class ArraySerializer
Expand Down

0 comments on commit c2b0ca1

Please sign in to comment.