|
|
|
@ -12,7 +12,8 @@ class PreviewDocumentPageController < ActionController::API
|
|
|
|
|
|
|
|
|
|
|
|
return head :not_found unless attachment
|
|
|
|
return head :not_found unless attachment
|
|
|
|
|
|
|
|
|
|
|
|
preview_image = attachment.preview_images.joins(:blob).find_by(blob: { filename: "#{params[:id]}#{FORMAT}" })
|
|
|
|
preview_image = attachment.preview_images.joins(:blob)
|
|
|
|
|
|
|
|
.find_by(blob: { filename: ["#{params[:id]}.png", "#{params[:id]}.jpg"] })
|
|
|
|
|
|
|
|
|
|
|
|
return redirect_to preview_image.url, allow_other_host: true if preview_image
|
|
|
|
return redirect_to preview_image.url, allow_other_host: true if preview_image
|
|
|
|
|
|
|
|
|
|
|
|
|