Method: Sequel::Plugins::StaticCache::ClassMethods#load_cache
- Defined in:
- lib/sequel/plugins/static_cache.rb
#load_cache ⇒ Object
Reload the cache for this model by retrieving all of the instances in the dataset freezing them, and populating the cached array and hash.
229 230 231 232 233 234 235 236 237 |
# File 'lib/sequel/plugins/static_cache.rb', line 229 def load_cache @all = load_static_cache_rows h = {} @all.each do |o| o.errors.freeze h[o.pk.freeze] = o.freeze end @cache = h.freeze end |