mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
15 lines
391 B
Ruby
15 lines
391 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module Paperclip
|
||
|
module TranscoderExtensions
|
||
|
# Prevent the transcoder from modifying our meta hash
|
||
|
def initialize(file, options = {}, attachment = nil)
|
||
|
meta_value = attachment&.instance_read(:meta)
|
||
|
super
|
||
|
attachment&.instance_write(:meta, meta_value)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
Paperclip::Transcoder.prepend(Paperclip::TranscoderExtensions)
|