Skip to content

Commit

Permalink
Fix wrongly removing files on transaction rollback
Browse files Browse the repository at this point in the history
Fixes #2685
  • Loading branch information
mshibuya committed Aug 17, 2023
1 parent d339c27 commit eb03fe1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/carrierwave/mounter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ def remote_urls=(urls)

def store!
uploaders.each(&:store!)
@added_uploaders += uploaders.reject(&:staged)
end

def write_identifier
Expand All @@ -154,6 +153,7 @@ def write_identifier
uploader.deduplicate(existing_identifiers)
existing_identifiers << uploader.identifier
end
@added_uploaders += additions

record.write_uploader(serialization_column, identifier)
end
Expand Down

0 comments on commit eb03fe1

Please sign in to comment.