UCSCLibrary / dams_project_mgmt

DAMS purpose is to provide access to digitized and born-digital UCSC Special Collections content. This repository is used for project planning. It holds the task tickets and roadmap for the different projects under DAMS.
2 stars 0 forks source link

Fix ActiveTriples::UndefinedPropertyError for Collection properties #511

Closed bkiahstroud closed 2 years ago

bkiahstroud commented 2 years ago

Summary

ScoobySnacks::WorkModelBehavior calls #accepts_nested_attributes_for, which finalizes the metadata schema, which causes two issues:

  1. All properties added after include ScoobySnacks::WorkModelBehavior will throw UndefinedPropertyErrors
  2. Hyrax::BasicMetadata also calls #accepts_nested_attributes_for, leading to a conflict

Instead of fixing the bug in ScoobySnacks, I opted to fix it in this repo since we'll need to bring the change over anyways once the ScoobySnacks gem is removed from the project

Testing Instructions

  1. Login as an admin
  2. Navigate to Dashboard > Importers > New
  3. Fill out required fields and upload a CSV that contains a Collection with a harmfulLanguageStatement
  4. Click "Create and Import"
  5. Navigate to the importer's show page. After a couple minutes, refresh the page
  6. Find the Collection entry and verify that no ActiveTriples::UndefinedPropertyError was thrown
  7. Navigate to the Collection's edit page (e.g. Importer > Collection Entry > Collection Link > Edit button)
  8. No error should be thrown
  9. Edit the metadata and click Save
  10. No error should be thrown

Acceptance Criteria

snehagunduraoUL commented 2 years ago

Works as expected. Can be closed.