0
0
Fork 0

Increase attachment descriptions to 420 characters (#5139)

Blaze it
This commit is contained in:
Eugen Rochko 2017-09-29 02:30:00 +02:00 committed by GitHub
parent d2f56d1cbc
commit 887cd94e96
3 changed files with 5 additions and 5 deletions

View file

@ -59,7 +59,7 @@ class MediaAttachment < ApplicationRecord
validates_attachment_size :file, less_than: 8.megabytes
validates :account, presence: true
validates :description, length: { maximum: 140 }, if: :local?
validates :description, length: { maximum: 420 }, if: :local?
scope :attached, -> { where.not(status_id: nil) }
scope :unattached, -> { where(status_id: nil) }
@ -140,7 +140,7 @@ class MediaAttachment < ApplicationRecord
end
def prepare_description
self.description = description.strip[0...140] unless description.nil?
self.description = description.strip[0...420] unless description.nil?
end
def set_type_and_extension