module Shrine::Plugins::Derivatives::VersionsCompatibility

  1. lib/shrine/plugins/derivatives.rb

Adds compatibility with how the versions plugin stores processed files.

Methods

Public Instance

  1. load_data

Public Instance methods

load_data(data)
[show source]
    # File lib/shrine/plugins/derivatives.rb
634 def load_data(data)
635   return super if data.nil?
636   return super if data["derivatives"] || data[:derivatives]
637   return super if (data["id"] || data[:id]).is_a?(String)
638 
639   data     = data.dup
640   original = data.delete("original") || data.delete(:original) || {}
641 
642   super original.merge("derivatives" => data)
643 end