Skip to content

Commit

Permalink
fix: Find by spam_probability
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentinchampenois committed Oct 22, 2024
1 parent 52623c5 commit 44f873a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/jobs/decidim/spam_detection/block_users_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def reported_spams_users
@reported_spams_users ||= Decidim::User.where(admin: false, blocked: false, deleted_at: nil)
.where("(extended_data #> '{spam_detection, unreported_at}') is null")
.where("(extended_data #> '{spam_detection, unblocked_at}') is null")
.where("(extended_data -> 'spam_detection' ->> 'probability')::float >= ?", spam_level)
.where("(extended_data -> 'spam_detection' ->> 'spam_probability')::float >= ?", spam_level)
end

def spam_level
Expand Down
2 changes: 1 addition & 1 deletion spec/factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
after(:build) do |user|
user.extended_data = user.extended_data
.dup
.deep_merge({ spam_detection: { reported_at: 1.day.ago, probability: 0.99 } })
.deep_merge({ spam_detection: { reported_at: 1.day.ago, spam_probability: 0.99 } })
end
end

Expand Down

0 comments on commit 44f873a

Please sign in to comment.