You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
391 B

  1. # frozen_string_literal: true
  2. module Paperclip
  3. module TranscoderExtensions
  4. # Prevent the transcoder from modifying our meta hash
  5. def initialize(file, options = {}, attachment = nil)
  6. meta_value = attachment&.instance_read(:meta)
  7. super
  8. attachment&.instance_write(:meta, meta_value)
  9. end
  10. end
  11. end
  12. Paperclip::Transcoder.prepend(Paperclip::TranscoderExtensions)