Method: Sequel::Plugins::SubsetStaticCache::CachedDatasetMethods#count

Defined in:
lib/sequel/plugins/subset_static_cache.rb

#count(*a, &block) ⇒ Object

Get the number of records in the cache, without issuing a database query, if no arguments or block are provided.

[View source]

140
141
142
143
144
145
146
# File 'lib/sequel/plugins/subset_static_cache.rb', line 140

def count(*a, &block)
  if a.empty? && !block && (all = @cache[:subset_static_cache_all])
    all.size
  else
    super
  end
end