Skip to content

Commit

Permalink
not storing empty result sets, but logging that we would have
Browse files Browse the repository at this point in the history
  • Loading branch information
staugaard committed Jul 14, 2011
1 parent 301a112 commit cdbf404
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/kasket/read_mixin.rb
Expand Up @@ -58,6 +58,8 @@ def store_in_kasket(key, records)
if records.first.kasket_cacheable?
Kasket.cache.write(key, records.first.instance_variable_get(:@attributes).dup)
end
elsif records.empty?
RAILS_DEFAULT_LOGGER.debug("[KASKET] would have stored an empty resultset") if defined?(RAILS_DEFAULT_LOGGER)
elsif records.size <= Kasket::CONFIGURATION[:max_collection_size]
if records.all?(&:kasket_cacheable?)
instance_keys = records.map do |record|
Expand Down

0 comments on commit cdbf404

Please sign in to comment.