Method: Cash::Query::Abstract#perform

Defined in:
lib/cash/query/abstract.rb

#perform(find_options = {}, get_options = {}) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/cash/query/abstract.rb', line 23

def perform(find_options = {}, get_options = {})
  if cache_config = cacheable?(@options1, @options2, find_options)
    cache_keys, index = cache_keys(cache_config[0]), cache_config[1]

    misses, missed_keys, objects = hit_or_miss(cache_keys, index, get_options)
    format_results(cache_keys, choose_deserialized_objects_if_possible(missed_keys, cache_keys, misses, objects))
  else
    logger.debug("  \e[1;4;31mUNCACHEABLE\e[0m #{table_name} - #{find_options.inspect} - #{get_options.inspect} - #{@options1.inspect} - #{@options2.inspect}") if logger
    uncacheable
  end
end