mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 03:35:25 +08:00
Update last_modified_by for assets on edit [SCI-10033]
This commit is contained in:
parent
cc29759dd9
commit
24faeae5de
4 changed files with 5 additions and 2 deletions
|
@ -34,7 +34,7 @@ class AssetSyncController < ApplicationController
|
|||
end
|
||||
|
||||
@asset.file.attach(io: request.body, filename: @asset.file.filename)
|
||||
@asset.touch
|
||||
@asset.update(last_modified_by: current_user)
|
||||
|
||||
log_activity
|
||||
|
||||
|
|
|
@ -187,6 +187,7 @@ class AssetsController < ApplicationController
|
|||
return render_403 unless can_read_team?(@asset.team)
|
||||
|
||||
@asset.file.attach(io: params.require(:image), filename: orig_file_name)
|
||||
@asset.last_modified_by = current_user
|
||||
@asset.save!
|
||||
create_edit_image_activity(@asset, current_user, :finish_editing)
|
||||
# release previous image space
|
||||
|
|
|
@ -91,6 +91,7 @@ class GeneSequenceAssetsController < ApplicationController
|
|||
file.blob.metadata['name'] = params[:sequence_name]
|
||||
file.save!
|
||||
@asset.view_mode = view_mode || @parent.assets_view_mode
|
||||
@asset.last_modified_by = current_user
|
||||
@asset.save!
|
||||
end
|
||||
end
|
||||
|
|
|
@ -28,7 +28,7 @@ class MarvinJsService
|
|||
connect_asset(asset, params, current_user)
|
||||
end
|
||||
|
||||
def update_sketch(params, _current_user, current_team)
|
||||
def update_sketch(params, current_user, current_team)
|
||||
if params[:object_type] == 'TinyMceAsset'
|
||||
asset = current_team.tiny_mce_assets.find(Base62.decode(params[:id]))
|
||||
attachment = asset&.image
|
||||
|
@ -40,6 +40,7 @@ class MarvinJsService
|
|||
|
||||
file = generate_image(params)
|
||||
attach_file(attachment, file, params)
|
||||
asset.update(last_modified_by: current_user) if asset.is_a?(Asset)
|
||||
asset.post_process_file(current_team) if asset.class == Asset
|
||||
asset
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue