mirror of
https://github.com/SrIzan10/hc-harbor.git
synced 2026-05-01 10:45:21 +00:00
fix upsert error
This commit is contained in:
@@ -55,10 +55,10 @@ class LeaderboardUpdateJob < ApplicationJob
|
||||
}
|
||||
end
|
||||
|
||||
LeaderboardEntry.insert_all!(entries, on_duplicate: :update, update_only: %i[total_seconds streak_count updated_at]) if entries.any?
|
||||
LeaderboardEntry.upsert_all(entries, unique_by: %i[leaderboard_id user_id]) if entries.any?
|
||||
|
||||
if data.keys.any?
|
||||
board.entries.where.not(user_id: data.keys).delete_all
|
||||
board.entries.where.not(user_id: data.keys).delete_all
|
||||
else
|
||||
board.entries.delete_all
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user