FIX: mixed local s3 store missing avatars

This commit is contained in:
Sam Saffron 2015-06-01 11:17:42 +10:00
parent e483176006
commit 97f03e699d
2 changed files with 7 additions and 4 deletions

View file

@ -23,11 +23,10 @@ class OptimizedImage < ActiveRecord::Base
return thumbnail unless thumbnail.nil?
# create the thumbnail otherwise
original_path = if Discourse.store.external?
original_path = Discourse.store.path_for(upload)
if original_path.blank?
external_copy = Discourse.store.download(upload)
external_copy.try(:path)
else
Discourse.store.path_for(upload)
original_path = external_copy.try(:path)
end
if original_path.blank?

View file

@ -126,6 +126,10 @@ end
class FakeExternalStore
def path_for(upload)
nil
end
def external?
true
end