mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-23 07:13:57 +08:00
removed object constantization
This commit is contained in:
parent
5a6202aea2
commit
44cb0db41a
1 changed files with 6 additions and 1 deletions
|
@ -47,7 +47,12 @@ class MarvinJsService
|
|||
private
|
||||
|
||||
def connect_asset(asset, params, current_user)
|
||||
object = params[:object_type].constantize.find(params[:object_id])
|
||||
object = case params[:object_type]
|
||||
when 'Step'
|
||||
Step.find(params[:object_id])
|
||||
when 'Result'
|
||||
Result.find(params[:object_id])
|
||||
end
|
||||
asset.update!(view_mode: object.assets_view_mode)
|
||||
object.assets << asset
|
||||
|
||||
|
|
Loading…
Reference in a new issue