Skip to content

A platform for community discussion. Free, open, simple.

DEV: Stabilize watched words order (#17215)

Jarek Radosz20e34b5da6e7
diff --git a/app/services/word_watcher.rb b/app/services/word_watcher.rb
index bc056fd6b46..443533a0c12 100644
--- a/app/services/word_watcher.rb
+++ b/app/services/word_watcher.rb
@@ -21,6 +21,7 @@ class WordWatcher
words = WatchedWord
.where(action: WatchedWord.actions[action.to_sym])
.limit(WatchedWord::MAX_WORDS_PER_ACTION)
+ .order(:id)
if WatchedWord.has_replacement?(action.to_sym)
words.pluck(:word, :replacement).to_h