diff options
author | Thibaut Girka <thib@sitedethib.com> | 2020-07-05 19:35:56 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2020-07-05 19:35:56 +0200 |
commit | 2d8be0a6e1fbe9da892937b05b373ab907d89b77 (patch) | |
tree | 73eb669adcc8b13c63dded5a887cb5ecc817894d /lib/paperclip/transcoder_extensions.rb | |
parent | 9b3677d5097fb50f90a6abdce9d722e81d2db469 (diff) | |
parent | 99f3a5554074d9a12619797c474b3de4c6085f02 (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - `.env.production.sample`: Upstream changed it completely. Changed ours to merge upstream's new structure, but keeping most of the information.
Diffstat (limited to 'lib/paperclip/transcoder_extensions.rb')
-rw-r--r-- | lib/paperclip/transcoder_extensions.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/paperclip/transcoder_extensions.rb b/lib/paperclip/transcoder_extensions.rb new file mode 100644 index 000000000..c0b2447f3 --- /dev/null +++ b/lib/paperclip/transcoder_extensions.rb @@ -0,0 +1,14 @@ +# 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) |