|
|
@ -1,6 +1,6 @@ |
|
|
|
class MediaAttachment < ApplicationRecord |
|
|
|
class MediaAttachment < ApplicationRecord |
|
|
|
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif'].freeze |
|
|
|
IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif'].freeze |
|
|
|
VIDEO_MIME_TYPES = ['video/webm'].freeze |
|
|
|
VIDEO_MIME_TYPES = ['video/webm', 'video/mp4'].freeze |
|
|
|
|
|
|
|
|
|
|
|
belongs_to :account, inverse_of: :media_attachments |
|
|
|
belongs_to :account, inverse_of: :media_attachments |
|
|
|
belongs_to :status, inverse_of: :media_attachments |
|
|
|
belongs_to :status, inverse_of: :media_attachments |
|
|
@ -43,6 +43,11 @@ private |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
original: { |
|
|
|
|
|
|
|
convert_options: {}, |
|
|
|
|
|
|
|
format: 'webm' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
small: { |
|
|
|
small: { |
|
|
|
convert_options: { |
|
|
|
convert_options: { |
|
|
|
output: { |
|
|
|
output: { |
|
|
|