DEV: Use AR enums in reviewables related code

This is the first patch of many to replace our custom enums in Ruby by
the ones provided by `ActiveRecord`.
This commit is contained in:
Loïc Guitaut
2021-12-08 18:12:24 +01:00
committed by Loïc Guitaut
parent 0c743a591f
commit 26fe047724
36 changed files with 220 additions and 228 deletions

View File

@@ -47,8 +47,7 @@ class SpamRule::FlagSockpuppets
private
def flag_post(post, message)
can_trust_user = ReviewableFlaggedPost.where(status: Reviewable.statuses[:rejected], target_created_by: post.user).exists?
return if can_trust_user
return if ReviewableFlaggedPost.rejected.exists?(target_created_by: post.user)
PostActionCreator.create(Discourse.system_user, post, :spam, message: message)
end