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:
@@ -52,11 +52,11 @@ class IpBan < ApplicationRecord
|
||||
|
||||
def create_mod_action
|
||||
if new_record?
|
||||
ModAction.log("#{creator.name} created ip ban for #{ip_addr}", :ip_ban_create)
|
||||
ModAction.log("created ip ban for #{ip_addr}", :ip_ban_create, creator)
|
||||
elsif is_deleted? == true && is_deleted_was == false
|
||||
ModAction.log("#{CurrentUser.user.name} deleted ip ban for #{ip_addr}", :ip_ban_delete)
|
||||
ModAction.log("deleted ip ban for #{ip_addr}", :ip_ban_delete)
|
||||
elsif is_deleted? == false && is_deleted_was == true
|
||||
ModAction.log("#{CurrentUser.user.name} undeleted ip ban for #{ip_addr}", :ip_ban_undelete)
|
||||
ModAction.log("undeleted ip ban for #{ip_addr}", :ip_ban_undelete)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user