Dream of the kind of world
you wanna live in.
Dream it out loud,
at high volume

Bono, U2

12 Mar 2012Calculate until saved

Let's say you have an attribute of an ActiveRecord object which is somehow calculated based on the state of the object, and let's assume this calculation is really expensive in terms of performance. Then calculate_until_saved might be for you:

Here's the module which you can easily store under lib/calculate_until_saved.rb

blog comments powered by Disqus

Related Posts