diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/tasks/assets.rake | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index e778021e..078d3c63 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake | |||
| @@ -6,6 +6,7 @@ namespace :assets do | |||
| 6 | FileAttachment::RASTERIZED_CONTENT_TYPES) | 6 | FileAttachment::RASTERIZED_CONTENT_TYPES) |
| 7 | scope = scope.where(id: ENV["ASSET_ID"]) if ENV["ASSET_ID"].present? | 7 | scope = scope.where(id: ENV["ASSET_ID"]) if ENV["ASSET_ID"].present? |
| 8 | 8 | ||
| 9 | skipped = [] | ||
| 9 | scope.find_each do |asset| | 10 | scope.find_each do |asset| |
| 10 | original_path = asset.send(:file_path, :original) | 11 | original_path = asset.send(:file_path, :original) |
| 11 | 12 | ||
| @@ -14,8 +15,16 @@ namespace :assets do | |||
| 14 | next | 15 | next |
| 15 | end | 16 | end |
| 16 | 17 | ||
| 17 | asset.send(:generate_all_variants, original_path) | 18 | if asset.send(:generate_all_variants, original_path) |
| 18 | puts "Regenerated variants for Asset##{asset.id} (#{asset.name})" | 19 | puts "Regenerated variants for Asset##{asset.id} (#{asset.name})" |
| 20 | else | ||
| 21 | skipped << asset.id | ||
| 22 | puts "Skipped Asset##{asset.id} (#{asset.name}) -- source has no rasterisable page" | ||
| 23 | end | ||
| 24 | end | ||
| 25 | |||
| 26 | if skipped.any? | ||
| 27 | puts "\n#{skipped.size} asset(s) skipped, no variants written: #{skipped.join(", ")}" | ||
| 19 | end | 28 | end |
| 20 | end | 29 | end |
| 21 | 30 | ||
