You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given an ActiveRecord model that has a mount_uploadcare_file attribute, a Uploadcare::FileApi.store_file is called on every save even when the mount_uploadcare_file attribute has not changed.
I would not expect a network request to be triggered when saving a model when the attribute hasn't changed.
I presume this could be easily fixed by checking if the attribute has changed and only then making the API call, but perhaps the current behavior is handling some edge case I am not aware of.
The text was updated successfully, but these errors were encountered:
Describe the bug
Given an ActiveRecord model that has a
mount_uploadcare_file
attribute, aUploadcare::FileApi.store_file
is called on every save even when themount_uploadcare_file
attribute has not changed.I would not expect a network request to be triggered when saving a model when the attribute hasn't changed.
The culprit seems to be:
uploadcare-rails/lib/uploadcare/rails/active_record/mount_uploadcare_file.rb
Line 50 in 428a7e6
and
uploadcare-rails/lib/uploadcare/rails/active_record/mount_uploadcare_file.rb
Lines 34 to 40 in 428a7e6
I presume this could be easily fixed by checking if the attribute has changed and only then making the API call, but perhaps the current behavior is handling some edge case I am not aware of.
The text was updated successfully, but these errors were encountered: