FIX: Cache all watched words (#14992)
It used to cache up to 1000 words, but the maximum number of watched word is 2000.
This commit is contained in:
parent
bf34d3524b
commit
186379adac
|
@ -8,7 +8,10 @@ class WordWatcher
|
|||
end
|
||||
|
||||
def self.words_for_action(action)
|
||||
words = WatchedWord.where(action: WatchedWord.actions[action.to_sym]).limit(1000)
|
||||
words = WatchedWord
|
||||
.where(action: WatchedWord.actions[action.to_sym])
|
||||
.limit(WatchedWord::MAX_WORDS_PER_ACTION)
|
||||
|
||||
if WatchedWord.has_replacement?(action.to_sym)
|
||||
words.pluck(:word, :replacement).to_h
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue