Skip to content

Commit 0e5e39b

Browse files
committed
Only purge files that are already persisted
The reasons for that being the case can be vast, but it does not make sense to purge things that are not persisted.
1 parent 432dc68 commit 0e5e39b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/nochmal/adapters/carrierwave_analyze.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def active_storage_change(type, uploader)
9292
# allow removal, carrierwave-style
9393
def remove_#{type}; false end
9494
def remove_#{type}=(deletion_param)
95-
if %w(1 yes true).include?(deletion_param.to_s.downcase)
95+
if %w(1 yes true).include?(deletion_param.to_s.downcase) && #{type}.persisted?
9696
#{type}.purge_later
9797
end
9898
end

0 commit comments

Comments
 (0)