diff --git a/app/controllers/admin/tags_controller.rb b/app/controllers/admin/tags_controller.rb index de761cbfbc7..17ad9bc62c0 100644 --- a/app/controllers/admin/tags_controller.rb +++ b/app/controllers/admin/tags_controller.rb @@ -39,9 +39,7 @@ module Admin def log_action_from_change action_log = current_account.action_logs.new(action: 'update', target: @tag) - action_log.usable = @tag.saved_changes['usable']&.last - action_log.trendable = @tag.saved_changes['trendable']&.last - action_log.listable = @tag.saved_changes['listable']&.last + action_log.log_changes = @tag.saved_changes.slice('usable', 'trendable', 'listable').transform_values(&:last) action_log.save end diff --git a/app/models/admin/action_log.rb b/app/models/admin/action_log.rb index 43e8ba7a969..54415fdb915 100644 --- a/app/models/admin/action_log.rb +++ b/app/models/admin/action_log.rb @@ -19,7 +19,7 @@ # class Admin::ActionLog < ApplicationRecord - TAG_ATTRIBUTES = %i(usable trendable listable).freeze + LOG_ATTRIBUTES = %i(usable trendable listable).freeze belongs_to :account belongs_to :target, polymorphic: true, optional: true @@ -28,7 +28,7 @@ class Admin::ActionLog < ApplicationRecord before_validation :set_route_param before_validation :set_permalink - store_accessor :tag_changes, *TAG_ATTRIBUTES + store_accessor :log_changes, *LOG_ATTRIBUTES scope :latest, -> { order(id: :desc) } diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml index f9763babe02..b4e7947171d 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -289,11 +289,11 @@ en-GB: enable_relay_html: "%{name} enabled the relay %{target}" enable_sign_in_token_auth_user_html: "%{name} enabled email token authentication for %{target}" enable_user_html: "%{name} enabled login for user %{target}" - listable_tag_html: "can be suggested" + listable_tag_html: can be suggested memorialize_account_html: "%{name} turned %{target}'s account into a memoriam page" - not_listable_tag_html: "won't be suggested" - not_trendable_tag_html: "won't appear under trends" - not_usable_tag_html: "cannot be used" + not_listable_tag_html: won't be suggested + not_trendable_tag_html: won't appear under trends + not_usable_tag_html: cannot be used promote_user_html: "%{name} promoted user %{target}" publish_terms_of_service_html: "%{name} published updates to the terms of service" reject_appeal_html: "%{name} rejected moderation decision appeal from %{target}" @@ -306,7 +306,7 @@ en-GB: sensitive_account_html: "%{name} marked %{target}'s media as sensitive" silence_account_html: "%{name} limited %{target}'s account" suspend_account_html: "%{name} suspended %{target}'s account" - trendable_tag_html: "can appear under trends" + trendable_tag_html: can appear under trends unassigned_report_html: "%{name} unassigned report %{target}" unblock_email_account_html: "%{name} unblocked %{target}'s email address" unsensitive_account_html: "%{name} unmarked %{target}'s media as sensitive" @@ -319,10 +319,10 @@ en-GB: update_ip_block_html: "%{name} changed rule for IP %{target}" update_report_html: "%{name} updated report %{target}" update_status_html: "%{name} updated post by %{target}" + update_tag_html: "%{name} changed %{target} settings to: %{usable} %{trendable} %{listable}" update_user_role_html: "%{name} changed %{target} role" update_username_block_html: "%{name} updated rule for usernames containing %{target}" - update_tag_html: "%{name} changed %{target} settings to: %{usable} %{trendable} %{listable}" - usable_tag_html: "can be used;" + usable_tag_html: can be used; deleted_account: deleted account empty: No logs found. filter_by_action: Filter by action diff --git a/spec/requests/admin/tags_spec.rb b/spec/requests/admin/tags_spec.rb index 25ddddd37aa..0dccd588d0c 100644 --- a/spec/requests/admin/tags_spec.rb +++ b/spec/requests/admin/tags_spec.rb @@ -25,7 +25,7 @@ RSpec.describe 'Admin Tags' do expect(response).to have_http_status(302) expect(Admin::ActionLog.last.human_identifier).to eq('#supertag') expect(Admin::ActionLog.pluck(:action)).to eq(%w(update)) - expect(Admin::ActionLog.pluck(:tag_changes)).to eq([{ 'listable' => false, 'trendable' => true }]) + expect(Admin::ActionLog.pluck(:log_changes)).to eq([{ 'listable' => false, 'trendable' => true }]) end end end