mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-09 21:36:44 +08:00
Fix applying last_modified_by at asset update [SCI-10033]
This commit is contained in:
parent
8fa1c21e73
commit
5276faa74b
3 changed files with 3 additions and 3 deletions
|
@ -37,8 +37,8 @@ class AssetSyncController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
ActiveRecord::Base.transaction do
|
ActiveRecord::Base.transaction do
|
||||||
@asset.file.attach(io: request.body, filename: @asset.file.filename)
|
|
||||||
@asset.update(last_modified_by: current_user)
|
@asset.update(last_modified_by: current_user)
|
||||||
|
@asset.file.attach(io: request.body, filename: @asset.file.filename)
|
||||||
|
|
||||||
log_activity(:edit)
|
log_activity(:edit)
|
||||||
end
|
end
|
||||||
|
|
|
@ -186,8 +186,8 @@ class AssetsController < ApplicationController
|
||||||
orig_file_name = @asset.file_name
|
orig_file_name = @asset.file_name
|
||||||
return render_403 unless can_read_team?(@asset.team)
|
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.last_modified_by = current_user
|
||||||
|
@asset.file.attach(io: params.require(:image), filename: orig_file_name)
|
||||||
@asset.save!
|
@asset.save!
|
||||||
create_edit_image_activity(@asset, current_user, :finish_editing)
|
create_edit_image_activity(@asset, current_user, :finish_editing)
|
||||||
# release previous image space
|
# release previous image space
|
||||||
|
|
|
@ -39,8 +39,8 @@ class MarvinJsService
|
||||||
return unless attachment
|
return unless attachment
|
||||||
|
|
||||||
file = generate_image(params)
|
file = generate_image(params)
|
||||||
attach_file(attachment, file, params)
|
|
||||||
asset.update(last_modified_by: current_user) if asset.is_a?(Asset)
|
asset.update(last_modified_by: current_user) if asset.is_a?(Asset)
|
||||||
|
attach_file(attachment, file, params)
|
||||||
asset.post_process_file if asset.instance_of?(Asset)
|
asset.post_process_file if asset.instance_of?(Asset)
|
||||||
asset
|
asset
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue