Merge pull request #2119 from aignatov-bio/ai-sci-fix-marvin-js-preview

Fix marvin JS preview
This commit is contained in:
aignatov-bio 2019-10-03 11:59:19 +02:00 committed by GitHub
commit afecc3fd0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,8 +18,7 @@ class AssetsController < ApplicationController
before_action :check_edit_permission, only: :edit
def file_preview
file_type = 'previewable' if @asset.previewable?
file_type ||= @asset.file.metadata[:asset_type]
file_type = @asset.file.metadata[:asset_type] || (@asset.previewable? ? 'previewable' : false)
response_json = {
'id' => @asset.id,
'type' => file_type,