module Shrine::Plugins::Derivatives::VersionsCompatibility

Adds compatibility with how the versions plugin stores processed files.

Public Instance Methods

load_data(data) click to toggle source
Calls superclass method
# File lib/shrine/plugins/derivatives.rb, line 630
def load_data(data)
  return super if data.nil?
  return super if data["derivatives"] || data[:derivatives]
  return super if (data["id"] || data[:id]).is_a?(String)

  data     = data.dup
  original = data.delete("original") || data.delete(:original) || {}

  super original.merge("derivatives" => data)
end