Sha256: 396483d86d85226d58cd4a45b2d4f7100b5a96590ff3e98a713687382851a6c5

Contents?: true

Size: 528 Bytes

Versions: 4

Compression:

Stored size: 528 Bytes

Contents

module ActiveSupport
  module MarshalWithAutoloading # :nodoc:
    def load(source)
      super(source)
    rescue ArgumentError, NameError => exc
      if exc.message.match(%r|undefined class/module (.+)|)
        # try loading the class/module
        $1.constantize
        # if it is an IO we need to go back to read the object
        source.rewind if source.respond_to?(:rewind)
        retry
      else
        raise exc
      end
    end
  end
end

Marshal.singleton_class.prepend(ActiveSupport::MarshalWithAutoloading)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activesupport-5.0.0.beta3 lib/active_support/core_ext/marshal.rb
activesupport-5.0.0.beta2 lib/active_support/core_ext/marshal.rb
activesupport-5.0.0.beta1.1 lib/active_support/core_ext/marshal.rb
activesupport-5.0.0.beta1 lib/active_support/core_ext/marshal.rb