about summary refs log tree commit diff
path: root/app/validators/status_length_validator.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-01-25 00:49:08 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-01-25 01:29:16 +0100
commit999cde94a6a2d67cf36160365378951d3b55b868 (patch)
tree51d86739522f79ee545f7c821507997f0a4914cb /app/validators/status_length_validator.rb
parentf8da0dd4907490f57cb14b052b767c66c95c4db3 (diff)
Instead of using spoiler boolean and spoiler_text, simply check for non-blank spoiler_text
Federate spoiler_text using warning attribute on <content /> instead of a <category term="spoiler" />
Clean up schema file from accidental development migrations
Diffstat (limited to 'app/validators/status_length_validator.rb')
-rw-r--r--app/validators/status_length_validator.rb15
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