nesquena / rabl

General ruby templating with json, bson, xml, plist and msgpack support
http://blog.codepath.com/2011/06/27/building-a-platform-api-on-rails/
MIT License
3.64k stars 334 forks source link

fix caching for rails 5 #675

Closed ehowe closed 4 years ago

ehowe commented 8 years ago

ActionView::Digestor does not have an initializer. The class methods available are digest, logger, and tree. Reading the documentation makes me think that Rabl::Digestor should just call super to get back to the necessary method.

ehowe commented 8 years ago

Full disclosure, I don't know the internal workings of rabl well enough to write a test that this will fix. I know that it fixed the tests in my rails app that were bombing out as a result. I'm more than willing to add a test if I can get some insight on how I could write a test that will touch that part of the codebase.

jhawthorn commented 8 years ago

We need a fix for this, rabl is entirely broken in rails 5 at the moment.

With this PR we are double locking and double caching: our code uses @@digest_monitor.synchronize and the action_view implementation will be using @@digest_mutex.synchronize. This probably works, but is unnecessary.

If we're calling super() to use the behaviour that the ActionView::Digestor provides we might as well just use their implementation in full without wrapping. That is the approach I've taken in #674

ram619prasad commented 8 years ago

Hi, I'm facing caching issue. Pls suggest me how to use this code or branch so that I can implement caching for my project.

olleolleolle commented 7 years ago

Just asking the question to the original poster and other users:

Does this commit: https://github.com/nesquena/rabl/commit/00d08f103def8218a9d8de81244a22026b982300 and the resulting, much-thinner Digestor make this issue go away?