mod actions: fix messages to use consistent format.

Fix mod actions to use the same message format everywhere.

Before mod actions were formatted in various inconsistent ways:

* "deleted post #1234"
* "comment #1234 updated by <user>"
* "<user> updated forum #1234"
* "<user> level changed Member -> Builder"

Now all mod actions consistently use this format:

* "deleted post #1234"
* "updated comment #1234"
* "updated forum #1234"
* "promoted <user> from Member to Builder"

This way mod actions are formatted consistently with other actions on
the /user_actions page, where everything is written as "<user> did X".

Also add a fix script to fix existing mod actions.
This commit is contained in:
evazion
2022-09-18 20:30:41 -05:00
parent 72e95b6ca3
commit 2119a8efc5
21 changed files with 224 additions and 33 deletions

View File

@@ -33,7 +33,7 @@ class PostRegenerationsControllerTest < ActionDispatch::IntegrationTest
assert_equal(@mod, ModAction.last.creator)
assert_equal("post_regenerate_iqdb", ModAction.last.category)
assert_equal("<@#{@mod.name}> regenerated IQDB for post ##{@post.id}", ModAction.last.description)
assert_equal("regenerated IQDB for post ##{@post.id}", ModAction.last.description)
end
end
@@ -55,7 +55,7 @@ class PostRegenerationsControllerTest < ActionDispatch::IntegrationTest
assert_equal(@mod, ModAction.last.creator)
assert_equal("post_regenerate", ModAction.last.category)
assert_equal("<@#{@mod.name}> regenerated image samples for post ##{@post.id}", ModAction.last.description)
assert_equal("regenerated image samples for post ##{@post.id}", ModAction.last.description)
end
should "fix the width and height of exif-rotated images" do