Rake task fixed for Shring
This commit is contained in:
parent
5ce1df07f3
commit
0a5c64d17c
1 changed files with 2 additions and 3 deletions
|
|
@ -10,10 +10,9 @@ namespace :debshots do
|
|||
# TODO: fix for Shrine - this only works for Paperclip
|
||||
Screenshot.all.each do |screenshot|
|
||||
# Check that the file actually exists
|
||||
path = screenshot.image.path(:large)
|
||||
# Rails.logger.info "- #{screenshot.id} (package: #{screenshot.package.name}) (path: #{path})"
|
||||
path = Rails.root.join('public' + screenshot.simage_url(:large))
|
||||
unless path and (File.file? path)
|
||||
Rails.logger.info "Screenshot #{screenshot.id} image file not found at path '#{path}'. Removing."
|
||||
Rails.logger.info "Screenshot ##{screenshot.id}'s image file not found at path '#{path}'. Removing."
|
||||
screenshot.delete
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue