Преглед изворни кода

Fix rules with same priority being sorted non-deterministically (#20623)

Eugen Rochko пре 1 година
родитељ
комит
2e2ba39abf
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      app/models/rule.rb

+ 1 - 1
app/models/rule.rb

@@ -18,5 +18,5 @@ class Rule < ApplicationRecord
 
   validates :text, presence: true, length: { maximum: 300 }
 
-  scope :ordered, -> { kept.order(priority: :asc) }
+  scope :ordered, -> { kept.order(priority: :asc, id: :asc) }
 end