mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-22 15:04:26 -04:00
Swap to iteration for now, so callbacks are happy
This commit is contained in:
1 parent
3b17265a92
commit
67a2005f1e
1 file changed
+3
@@ -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