mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
committed by
Loïc Guitaut
parent
0c743a591f
commit
26fe047724
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user