Merge commit '086db72e727ab529b32d7bd2184c323f127ab5af' into glitch-soc/merge-upstream
This commit is contained in:
commit
069738cd40
13 files changed
+871
-775
No files matched your search
@@ -17,12 +17,15 @@ module Admin
|
||||
authorize @tag, :show?
|
||||
|
||||
@time_period = report_range
|
||||
@action_logs = Admin::ActionLogFilter.new(target_tag: @tag.formatted_name).results.limit(5)
|
||||
end
|
||||
|
||||
def update
|
||||
authorize @tag, :update?
|
||||
|
||||
if @tag.update(tag_params.merge(reviewed_at: Time.now.utc))
|
||||
log_action_from_change if @tag.saved_changes?
|
||||
|
||||
redirect_to admin_tag_path(@tag.id), notice: I18n.t('admin.tags.updated_msg')
|
||||
else
|
||||
@time_period = report_range
|
||||
@@ -33,6 +36,13 @@ module Admin
|
||||
|
||||
private
|
||||
|
||||
def log_action_from_change
|
||||
action_log = current_account.action_logs.new(action: 'update', target: @tag)
|
||||
|
||||
action_log.recorded_changes = @tag.saved_changes.slice('usable', 'trendable', 'listable').transform_values(&:last)
|
||||
action_log.save
|
||||
end
|
||||
|
||||
def set_tag
|
||||
@tag = Tag.find(params[:id])
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user