Saving the copy ingredient does not automatically save the entire object tree unless autosave: true is configured.
Therefore, the changes under if new_user.present? are never persisted.
This resulted in strange error messages (e.g., Couldn't find user_workload with id 20) because they couldn't
be accessed by the proper user anymore (they usually belonged to the admin then).
Saving the
copy
ingredient does not automatically save the entire object tree unlessautosave: true
is configured. Therefore, the changes underif new_user.present?
are never persisted. This resulted in strange error messages (e.g.,Couldn't find user_workload with id 20
) because they couldn't be accessed by the proper user anymore (they usually belonged to the admin then).