diff options
Diffstat (limited to 'app/validators')
-rw-r--r-- | app/validators/status_length_validator.rb | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb deleted file mode 100644 index 5491d3d5f..000000000 --- a/app/validators/status_length_validator.rb +++ /dev/null @@ -1,15 +0,0 @@ -class StatusLengthValidator < ActiveModel::Validator - def validate(status) - if status.local? && !status.reblog? - combinedText = status.text - if (status.spoiler? && status.spoiler_text.present?) - combinedText = status.spoiler_text + "\n" + status.text - end - - maxChars = 500 - unless combinedText.length <= maxChars - status.errors[:text] << "is too long (maximum is #{maxChars})" - end - end - end -end \ No newline at end of file |