Forum: Ruby on Rails undefined AR class module for Marshal

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
525128e48ca2b4c7fb6176ea166fccfd?d=identicon&s=25 Eric G. (gotskill10)
on 2007-07-24 05:15
When I do Marshal.load, and the data includes AR classes, it gives me an
undefined  class/module error along with the AR class name.

If I require the model files right before calling Marshal.load, it will
work fine. I don't want to be requiring the AR models everytime I call

Whats confusing is that if I do any kind of AR actions/methods (i.e.
Model.find), it will work fine without having to require the models

Why do I have to re-require the AR models if I Marshal.load the AR
525128e48ca2b4c7fb6176ea166fccfd?d=identicon&s=25 Eric G. (gotskill10)
on 2007-11-15 22:14
This consistently happens to me still with unmarshalling data.

Is there any work around to this?
This topic is locked and can not be replied to.