Update last_modified_by for assets on edit [SCI-10033]

This commit is contained in:
Ivan Kljun 2024-01-24 15:18:34 +01:00
parent cc29759dd9
commit 24faeae5de
4 changed files with 5 additions and 2 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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