Module: IdentityCache::QueryAPI::ClassMethods

Defined in:
lib/identity_cache/query_api.rb

Instance Method Summary collapse

Instance Method Details

#cached_association(name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



17
18
19
# File 'lib/identity_cache/query_api.rb', line 17

def cached_association(name) # :nodoc:
  cached_has_manys[name] || cached_has_ones[name] || cached_belongs_tos.fetch(name)
end

#prefetch_associations(includes, records) ⇒ Object

Prefetches cached associations on a collection of records



12
13
14
# File 'lib/identity_cache/query_api.rb', line 12

def prefetch_associations(includes, records)
  Cached::Prefetcher.prefetch(self, includes, records)
end