ソースを参照

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