Merge remote-tracking branch 'origin/master' into gs-master

Conflicts:
 	app/javascript/styles/mastodon/components.scss
 	app/models/media_attachment.rb
This commit is contained in:
David Yip
2018-03-27 10:26:47 -05:00
24 changed files with 151 additions and 54 deletions

View File

@ -74,6 +74,8 @@ class MediaAttachment < ApplicationRecord
},
}.freeze
LIMIT = 8.megabytes
belongs_to :account, inverse_of: :media_attachments, optional: true
belongs_to :status, inverse_of: :media_attachments, optional: true
@ -85,7 +87,8 @@ class MediaAttachment < ApplicationRecord
include Remotable
validates_attachment_content_type :file, content_type: IMAGE_MIME_TYPES + VIDEO_MIME_TYPES + AUDIO_MIME_TYPES
validates_attachment_size :file, less_than: 8.megabytes
validates_attachment_size :file, less_than: LIMIT
remotable_attachment :file, LIMIT
validates :account, presence: true
validates :description, length: { maximum: 420 }, if: :local?