FEATURE: Increase maximum watched word length from 50 to 100 chars (#11437)

This is useful for more complex regex watched words

https://meta.discourse.org/t/166249
This commit is contained in:
David Taylor 2020-12-09 06:45:34 +00:00 committed by GitHub
parent e50676caff
commit 942888a10c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ class WatchedWord < ActiveRecord::Base
self.word = self.class.normalize_word(self.word)
end
validates :word, presence: true, uniqueness: true, length: { maximum: 50 }
validates :word, presence: true, uniqueness: true, length: { maximum: 100 }
validates :action, presence: true
validates_each :word do |record, attr, val|
if WatchedWord.where(action: record.action).count >= MAX_WORDS_PER_ACTION