Fix #4670: Replace RequestStore with AS::CurrentAttributes.

This also requires replacing CurrentUser.name with CurrentUser.user.name
because the `name` method had a conflict with CurrentAttributes.
This commit is contained in:
evazion
2021-01-16 12:43:20 -06:00
parent 6f6ec6592d
commit 6ca007ee1f
11 changed files with 32 additions and 91 deletions

View File

@@ -18,10 +18,10 @@ class ForumPost < ApplicationRecord
validates_presence_of :body
after_save :delete_topic_if_original_post
after_update(:if => ->(rec) {rec.updater_id != rec.creator_id}) do |rec|
ModAction.log("#{CurrentUser.name} updated forum ##{rec.id}", :forum_post_update)
ModAction.log("#{CurrentUser.user.name} updated forum ##{rec.id}", :forum_post_update)
end
after_destroy(:if => ->(rec) {rec.updater_id != rec.creator_id}) do |rec|
ModAction.log("#{CurrentUser.name} deleted forum ##{rec.id}", :forum_post_delete)
ModAction.log("#{CurrentUser.user.name} deleted forum ##{rec.id}", :forum_post_delete)
end
deletable