Przeglądaj źródła

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

Eugen Rochko 1 rok temu
rodzic
commit
2e2ba39abf
1 zmienionych plików z 1 dodań i 1 usunięć
  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