瀏覽代碼

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