Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3.3.4 #128

Merged
merged 2 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based now on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 3.3.4 — 2023-04-04

### Changed

* Skipped network requests when the file attribute was unchanged (fixed https://github.com/uploadcare/uploadcare-rails/issues/127)

## 3.3.3 — 2023-03-27

### Changed
Expand Down
5 changes: 4 additions & 1 deletion lib/uploadcare/rails/active_record/mount_uploadcare_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ def mount_uploadcare_file(attribute)
Uploadcare::FileApi.delete_file(file_uuid)
end

after_save "uploadcare_store_#{attribute}!".to_sym unless Uploadcare::Rails.configuration.do_not_store
unless Uploadcare::Rails.configuration.do_not_store
after_save "uploadcare_store_#{attribute}!".to_sym, if: "will_save_change_to_#{attribute}?".to_sym
end

return unless Uploadcare::Rails.configuration.delete_files_after_destroy

after_destroy "uploadcare_delete_#{attribute}!".to_sym
Expand Down