mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
FIX: Query syntax error in UserBadge.update_featured_ranks!
(#30979)
This commit fixes an SQL syntax error in `UserBadge.update_featured_ranks!` when the `user_ids` param is an empty array `[]`. This was causing the `Jobs::BackfillBadge` job to raise the following exceptions: ``` Job exception: ERROR: syntax error at or near ")" LINE 6: AND user_id IN () ``` This commit fixes the same error in `UserState.update_distinct_badge_count` as well Follow-up to 3e4eac0fed05daedcdea50d6275e143469d55eda
This commit is contained in:

committed by
GitHub

parent
084ed7a457
commit
62c6ee0de7
@ -215,7 +215,7 @@ RSpec.describe UserStat do
|
||||
end
|
||||
end
|
||||
|
||||
describe "update_distinct_badge_count" do
|
||||
describe ".update_distinct_badge_count" do
|
||||
fab!(:user)
|
||||
let(:stat) { user.user_stat }
|
||||
fab!(:badge1) { Fabricate(:badge) }
|
||||
|
Reference in New Issue
Block a user