CurrentUser: remove #as method.

Replace with CurrentUser#scoped.
This commit is contained in:
evazion
2021-06-22 23:39:30 -05:00
parent 7f0edc32dd
commit e5cfb7904c
11 changed files with 12 additions and 22 deletions

View File

@@ -72,7 +72,7 @@ class BulkUpdateRequest < ApplicationRecord
end
def create_forum_topic
CurrentUser.as(user) do
CurrentUser.scoped(user) do
body = "[bur:#{id}]\n\n#{reason}"
self.forum_topic = ForumTopic.create(title: title, category_id: 1, creator: user) unless forum_topic.present?
self.forum_post = forum_topic.forum_posts.create(body: body, creator: user) unless forum_post.present?