avalonmediasystem / avalon

Avalon Media System – Samvera Application
http://www.avalonmediasystem.org/
Apache License 2.0
94 stars 51 forks source link

Remove extra saves from Edit step models #6071

Closed masaball closed 2 weeks ago

masaball commented 1 month ago

Each step of the edit process has its own model which interfaces with the avalon-workflow gem to perform updates. In avalon-workflow, the update method saves the object.

In all, or nearly all, of our models for the edit steps we explicitly save the media object as well. The resource_description_step saves the media object twice in certain cases (the update_attributes method performs a save, immediately followed by another save after exiting the if/else block). I am unsure how much overall this would reduce timings, but we should try to remove the extra saves so that each step is only performing one save.

Done Looks Like

elynema commented 3 weeks ago

The old avalon_workflow gem was saving objects, but then avalon was also explicitly saving. Removed the secondary save from avalon code.

abankhele commented 2 weeks ago

I have tested the following actions: record creation, editing structure metadata, modifying access control, and adding a new section. All functionalities performed smoothly, with no issues encountered.