Class: Marshal
- Inherits:
-
Object
- Object
- Marshal
- Defined in:
- lib/marshal_extension.rb
Overview
Shamelessly swiped from: pastie.org/720905 Initial implementation from: kballcodes.com/2009/09/05/rails-memcached-a-better-solution-to-the-undefined-classmodule-problem/
Class Method Summary collapse
Class Method Details
.load_with_rails_classloader(*args) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/marshal_extension.rb', line 4 def load_with_rails_classloader(*args) begin load_without_rails_classloader(*args) rescue ArgumentError, NameError => e if e. =~ %r(undefined class/module) const = e..split(' ').last const.constantize retry else raise(e) end end end |