Module: ActionCost::RecordCache::IndexHook

Defined in:
lib/action_cost/record_cache/index_hook.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
10
11
12
# File 'lib/action_cost/record_cache/index_hook.rb', line 7

def self.included(base)
  puts "action_cost including RecordCache::IndexHook"
  base.class_eval do
    alias_method_chain :get_records, :action_cost
  end
end

Instance Method Details

#get_records_with_action_cost(keys) ⇒ Object



14
15
16
17
18
19
# File 'lib/action_cost/record_cache/index_hook.rb', line 14

def get_records_with_action_cost(keys)
  Rails.logger.debug "get_records_with_action_cost: keys=#{keys.inspect}"
  parser = ActionCost::RecordCacheParser.new(table_name)
  ActionCost::Middleware.push_sql_parser(parser)
  get_records_without_action_cost(keys)
end