mongoid / mongoid-history

Multi-user non-linear history tracking, auditing, undo, redo for mongoid.
https://rubygems.org/gems/mongoid-history
MIT License
391 stars 129 forks source link

Remove memoization #72

Open johnnyshields opened 11 years ago

johnnyshields commented 11 years ago

I think a lot of the memoization (at least in Trackable class) should be removed. Given that Mongoid already caches queries, I don't think it actually reduces db hits, and moreover it seems to be cleared frequently. I think it mainly adds complexity and potential for bugs. Was there a real use case for implementing it?

dblock commented 11 years ago

I doubt that this was ever intentional.

aq1018 commented 10 years ago

I actually did do this intentionally because I didn't know for sure if the queries are cached. I guess I pre-optimized a bit too much. Feel free to remove as you see fit.