Sha256: f855b155193aab84969e641adbfa76a81e588390fd3b5c22e7167711ff405d5b
Contents?: true
Size: 643 Bytes
Versions: 52
Compression:
Stored size: 643 Bytes
Contents
### This patch is going into active-support (rails 4). https://github.com/rails/rails/pull/8246 module Marshal class << self def load_with_autoloading(source) begin load_without_autoloading(source) rescue ArgumentError, NameError => exc if exc.message.match(%r|undefined class/module (.+)|) # try loading the class/module $1.constantize # if it is a IO we need to go back to read the object source.rewind if source.respond_to?(:rewind) retry else raise exc end end end alias_method_chain :load, :autoloading end end
Version data entries
52 entries across 52 versions & 2 rubygems