Guest User

Untitled

a guest
Jul 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. class << Marshal
  2. def load_with_rails_classloader(*args)
  3. begin
  4. load_without_rails_classloader(*args)
  5. rescue ArgumentError, NameError => e
  6. if e.message =~ %r(undefined class/module)
  7. const = e.message.split(' ').last
  8. const.constantize
  9. retry
  10. else
  11. raise(e)
  12. end
  13. end
  14. end
  15. alias_method_chain :load, :rails_classloader
  16. end
Add Comment
Please, Sign In to add comment