Closed LindseySaari closed 3 years ago
I ran the following:
subclasses = SavedClaim.descendants.collect{ |d| d.name }
Thread started here. Hopefully someone has some background information
SavedClaim.where("type NOT IN (?)", subclasses).count
There are 156 records that have a type/subclass of something other than a child class of SavedClaim 11616 in prod
Update:
I’ve narrowed down the STI issues with non existing types/subclasses of SavedClaim. There are two types in question: SavedClaim::DisabilityCompensation::Form526IncreaseOnly
and SavedClaim::EducationBenefits::VA1995s
For the SavedClaim::DisabilityCompensation::Form526IncreaseOnly
records, it looks like SavedClaim::DisabilityCompensation
class was removed here. I've asked in the vsa-engineering channel and the vsa-claims-appeals channel. It's believed that these records are stale and can be removed, but need to check with the product owner
The SavedClaim::EducationBenefits::VA1995s
was removed in this PR. I've asked in this vsa-education slack channel here. Next step is to see if this data is stale/can be deleted or if we need to migrate it to another class.
According to Daniel Shawkey, the VA1995s records can be deleted
Issue Description
While testing the attr_encrypted key rotation in the dev and staging environments, a few instances of ActiveRecord::SubclassNotFound errors were found.
ActiveRecord::SubclassNotFound (The single-table inheritance mechanism failed to locate the subclass errors for the SavedClaim records
It seems that the type column is from a subclass the no longer exists. With Single Table Inheritance, the type column is used to saved the class name of child classes. Ex:
CentralMailClaim < SavedClaim
Ex: run SavedClaim.first in the staging env to see the mentioned issue
It's most likely that we have old data in the type column and it needs to be updated/deleted OR maybe this table is not meant to use STI?
More background information is needed
Tasks
Acceptance Criteria
[ ] What will be created or happen as a result of this story?
How to configure this issue
product support
,analytics-insights
,operations
,service-design
,tools-be
,tools-fe
)backend
,frontend
,devops
,design
,research
,product
,ia
,qa
,analytics
,contact center
,research
,accessibility
,content
)bug
,request
,discovery
,documentation
, etc.)