This pull request addresses a bug with saving a MorphMany relationship where records are not properly filtered by their type before being updated. This causes the type column of some records to be incorrectly overwritten, leading to data inconsistencies and duplicate records.
Steps to Reproduce:
Create two CuratorPicker components with different typeValue attributes for the same relationship:
Hi,
This pull request addresses a bug with saving a MorphMany relationship where records are not properly filtered by their type before being updated. This causes the type column of some records to be incorrectly overwritten, leading to data inconsistencies and duplicate records.
Steps to Reproduce:
Create two CuratorPicker components with different typeValue attributes for the same relationship:
Select the same file in both pickers and save. The first save works correctly.
Save again, and observe that all media_items are incorrectly updated to type 't1', with a new record created for type 't2'.
This fix ensures that records are filtered by typeValue before updates, preventing incorrect modifications and maintaining data integrity.