Browse Source

Validation of count works even when text of status is nil (#6429)

pull/4/head
abcang 6 years ago
committed by Eugen Rochko
parent
commit
9b6223f5e2
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      app/validators/status_length_validator.rb

+ 2
- 0
app/validators/status_length_validator.rb View File

@ -23,6 +23,8 @@ class StatusLengthValidator < ActiveModel::Validator
end
def countable_text(status)
return '' if status.text.nil?
status.text.dup.tap do |new_text|
new_text.gsub!(FetchLinkCardService::URL_PATTERN, 'x' * 23)
new_text.gsub!(Account::MENTION_RE, '@\2')

Loading…
Cancel
Save