mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-18 21:56:55 -04:00
Swap to iteration for now, so callbacks are happy
This commit is contained in:
@@ -15,6 +15,9 @@ namespace :openfarm do
|
||||
photos_to_delete = Photo.where(source: 'openfarm')
|
||||
count = photos_to_delete.count
|
||||
photos_to_delete.each do |photo|
|
||||
photo.associations.each do |photo_association|
|
||||
photo_association.delete
|
||||
end
|
||||
photo.delete
|
||||
end
|
||||
puts "Deleted #{count} pictures."
|
||||
|
||||
Reference in New Issue
Block a user