mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
Remove unnecessary code from MediaAttachment#set_type_and_extension.
Well, it seems unnecessary, anyway.
This commit is contained in:
parent
c816701550
commit
106a5d7b83
@ -200,9 +200,6 @@ class MediaAttachment < ApplicationRecord
|
|||||||
|
|
||||||
def set_type_and_extension
|
def set_type_and_extension
|
||||||
self.type = VIDEO_MIME_TYPES.include?(file_content_type) ? :video : AUDIO_MIME_TYPES.include?(file_content_type) ? :audio : :image
|
self.type = VIDEO_MIME_TYPES.include?(file_content_type) ? :video : AUDIO_MIME_TYPES.include?(file_content_type) ? :audio : :image
|
||||||
extension = AUDIO_MIME_TYPES.include?(file_content_type) ? '.mp4' : appropriate_extension
|
|
||||||
basename = Paperclip::Interpolations.basename(file, :original)
|
|
||||||
file.instance_write :file_name, [basename, extension].delete_if(&:blank?).join('.')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_meta
|
def set_meta
|
||||||
|
Loading…
Reference in New Issue
Block a user