mhgbrown / cached_resource

Caching for ActiveResource
MIT License
80 stars 28 forks source link

store objects as json in cache to avoid undefined class/module on relations #22

Closed Adrian2112 closed 6 years ago

Adrian2112 commented 9 years ago

Active resource create new clases for each of the different relations that a model has. When you cache an object and then try to read it after reloading the app the new class does not exist, thats why we get the undefined class/module

One approach is to define the relation classes yourself, but we can let ActiveResource handle it passing it the stored json.

this is related to the issue #6

mhgbrown commented 9 years ago

Sorry for the late response - vacationing. Thanks for this. I'll give this a closer look in the coming days.

benoror commented 6 years ago

@Adrian2112 @mhgbrown Hey guys! I know it's been a while 🙈, but we (@Daniel-ltw & me) stumbled upon this bug related to this very PR: https://github.com/mhgbrown/cached_resource/issues/33

Would love to see this merged. Anything we can do to help? let us know!

Cheers! 🍻

Daniel-ltw commented 6 years ago

@benoror If you could fork what @Adrian2112 has and finish that up, that would also be good.

I could probably merge that in and tap @mhgbrown to up the version of the gem.

That would do the trick.

mhgbrown commented 6 years ago

@benoror @Daniel-ltw I'm at your disposal!