So not only does the moment of upload change, but we have a difference in the behavior of an upload file vs a file from local file system (attachment_changes['file'].attachable[:io] vs attachment_changes['file'].attachable).
This pr tries to handle this.
Furthermore there is a switch to stop attachment change tracking and infinite loops by disabling the before_save hook.
This is a follow up/rewrite to PR #291
Since rail 6 the workflow of the uploading has changed (see https://stackoverflow.com/a/57591408) Further reading: https://github.com/rails/rails/pull/33303 & https://github.com/rails/rails/pull/37005
So not only does the moment of upload change, but we have a difference in the behavior of an upload file vs a file from local file system (attachment_changes['file'].attachable[:io] vs attachment_changes['file'].attachable). This pr tries to handle this.
Furthermore there is a switch to stop attachment change tracking and infinite loops by disabling the before_save hook.