about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-22 21:39:53 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-22 21:39:53 +0200
commitc6d893a71dede65dd88a0dfac81178c8e81e27d2 (patch)
treebb557a00fc8be550f32bec792be4530dc0729643 /app/models
parentb1a670af8d098c33a8938662f5c0bd60674ea683 (diff)
Uploading/undoing media modifies status text. Also: status text trimmed before validation
Diffstat (limited to 'app/models')
-rw-r--r--app/models/status.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index e336cfe62..ae5c4b496 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -89,4 +89,8 @@ class Status < ApplicationRecord
   def self.reblogs_map(status_ids, account_id)
     self.where(reblog_of_id: status_ids).where(account_id: account_id).map { |s| [s.reblog_of_id, true] }.to_h
   end
+
+  before_validation do
+    self.text.strip!
+  end
 end