diff --git a/app/models/concerns/randomizable.rb b/app/models/concerns/randomizable.rb index c346f1f02..98a86b426 100644 --- a/app/models/concerns/randomizable.rb +++ b/app/models/concerns/randomizable.rb @@ -3,7 +3,7 @@ module Randomizable class_methods do def sort_by_random(seed = rand(10_000_000)) - ids = pluck(:id).shuffle(random: Random.new(seed)) + ids = order(:id).pluck(:id).shuffle(random: Random.new(seed)) return all if ids.empty?