summaryrefslogtreecommitdiffstats
path: root/spec/unit/util/cache_accumulator.rb
Commit message (Collapse)AuthorAgeFilesLines
* [#3994] rename the specs to have _spec.rb at the endMarkus Roberts2010-06-231-69/+0
| | | | | | | | | Some spec files like active_record.rb had names that would confuse the load path and get loaded instead of the intended implentation when the spec was run from the same directory as the file. Author: Matt Robinson <matt@puppetlabs.com> Date: Fri Jun 11 15:29:33 2010 -0700
* Removed extra whitespace from end of linesIan Taylor2009-06-061-1/+1
|
* Initial implementation of a "cache accumulator" behavior.Ethan Rowe2009-04-221-0/+69
Mix Puppet::Util::CacheAccumulator into an ActiveRecord-like class, and then for any attribute in that class on which you are likely to call find_or_create_by_*, specify: accumulates :foo and instead of :find_or_create_by_foo use :accumulate_by_foo. The class will cache known results keyed by values of :foo. Do an initial bulk-lookup: class.accumulate_by_foo('foo1', 'foo2', 'foo3', 'foo4')