about summary refs log tree commit diff
path: root/app/models/media_attachment.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/media_attachment.rb')
-rw-r--r--app/models/media_attachment.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb
index 3277eb227..c29a66eb2 100644
--- a/app/models/media_attachment.rb
+++ b/app/models/media_attachment.rb
@@ -46,6 +46,9 @@ class MediaAttachment < ApplicationRecord
                     styles: ->(f) { file_styles f },
                     processors: ->(f) { file_processors f },
                     convert_options: { all: '-quality 90 -strip' }
+
+  include Remotable
+
   validates_attachment_content_type :file, content_type: IMAGE_MIME_TYPES + VIDEO_MIME_TYPES
   validates_attachment_size :file, less_than: 8.megabytes
 
@@ -59,10 +62,6 @@ class MediaAttachment < ApplicationRecord
     remote_url.blank?
   end
 
-  def file_remote_url=(url)
-    self.file = URI.parse(Addressable::URI.parse(url).normalize.to_s)
-  end
-
   def to_param
     shortcode
   end