Fix infinite update for image annotation (#1889)

This commit is contained in:
aignatov-bio 2019-07-03 15:35:49 +02:00 committed by GitHub
parent d147e8260d
commit 09dacf3be2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,6 +11,7 @@ class AssetsController < ApplicationController
include ApplicationHelper
include InputSanitizeHelper
include FileIconsHelper
include MyModulesHelper
before_action :load_vars, except: :create_wopi_file
before_action :check_read_permission, except: :file_present
@ -177,6 +178,9 @@ class AssetsController < ApplicationController
@asset.step&.protocol&.update(updated_at: Time.now)
render_html = if @asset.step
assets = @asset.step.assets
order_atoz = az_ordered_assets_index(assets, @asset.id)
order_ztoa = assets.length - az_ordered_assets_index(assets, @asset.id)
asset_position = @asset.step.asset_position(@asset)
render_to_string(
partial: 'steps/attachments/item.html.erb',
@ -184,7 +188,9 @@ class AssetsController < ApplicationController
asset: @asset,
i: asset_position[:pos],
assets_count: asset_position[:count],
step: @asset.step
step: @asset.step,
order_atoz: order_atoz,
order_ztoa: order_ztoa
},
formats: :html
)