mhgbrown / cached_resource

Caching for ActiveResource
MIT License
80 stars 28 forks source link

TypeError: singleton can't be dumped for ActiveResource models #7

Closed fhirzall closed 11 years ago

fhirzall commented 11 years ago

This is on rails 3.2.12, standard API-backed ActiveResource fails when calling #all.

Any ideas why this might be happening?

mhgbrown commented 11 years ago

Hmm, no immediate ideas. Is there a stack trace you could provide?

Could it be related to this? "Finally, a word of caution. Once you've created a singleton class for an object you can no longer use Marshal.dump on that object. The marshal library doesn't support objects with singleton classes:" -http://www.devalot.com/articles/2008/09/ruby-singleton

fhirzall commented 11 years ago

Thanks for the response. It actually was an issue with a singleton class. I had a separate mixin that was extending something in ActiveResource which turned it into a singelton object.

Thanks for the library!

mhgbrown commented 11 years ago

No problem! I'm slowly working on Rails 4/Ruby 2.0.0.