Module: ConstantCache::CacheMethods::ClassMethods
- Defined in:
- lib/constant_cache/cache_methods.rb
Instance Method Summary collapse
Instance Method Details
#caches_constants(additional_options = {}) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/constant_cache/cache_methods.rb', line 9 def caches_constants( = {}) cattr_accessor :cache_options self. = {:key => :name, :limit => 64}.merge() raise ConstantCache::InvalidLimitError, "Limit of #{self.[:limit]} is invalid" if self.[:limit] < 1 find(:all).each {|model| model.set_instance_as_constant } end |