mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: uploads rake tasks to support subfolders
This commit is contained in:
parent
f4cb96ff9a
commit
b489384b59
1 changed files with 4 additions and 4 deletions
|
@ -175,7 +175,7 @@ task "uploads:missing" => :environment do
|
|||
Upload.order(:id).find_each do |upload|
|
||||
|
||||
# could be a remote image
|
||||
next unless upload.url =~ /^\/uploads\//
|
||||
next unless upload.url =~ /^\/[^\/]/
|
||||
|
||||
path = "#{public_directory}#{upload.url}"
|
||||
bad = true
|
||||
|
@ -190,7 +190,7 @@ task "uploads:missing" => :environment do
|
|||
OptimizedImage.order(:id).find_each do |optimized_image|
|
||||
|
||||
# remote?
|
||||
next unless optimized_image.url =~ /^\/uploads\//
|
||||
next unless optimized_image.url =~ /^\/[^\/]/
|
||||
|
||||
path = "#{public_directory}#{optimized_image.url}"
|
||||
|
||||
|
@ -237,8 +237,8 @@ def regenerate_missing_optimized
|
|||
|
||||
upload = optimized_image.upload
|
||||
|
||||
next unless optimized_image.url =~ /^\/uploads\//
|
||||
next unless upload.url =~ /^\/uploads\//
|
||||
next unless optimized_image.url =~ /^\/[^\/]/
|
||||
next unless upload.url =~ /^\/[^\/]/
|
||||
|
||||
thumbnail = "#{public_directory}#{optimized_image.url}"
|
||||
original = "#{public_directory}#{upload.url}"
|
||||
|
|
Loading…
Reference in a new issue