Module: ActiveRecord::ConnectionAdapters::QueryCache

Included in:
IBM_DBAdapter
Defined in:
lib/active_record/connection_adapters/ibm_db_pstmt.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



1847
1848
1849
1850
1851
# File 'lib/active_record/connection_adapters/ibm_db_pstmt.rb', line 1847

def included(base)
  base.class_eval do
    alias_method_chain :prepared_select, :query_cache
  end
end

Instance Method Details

#prepared_select_with_query_cache(sql_param_hash, name = nil) ⇒ Object



1854
1855
1856
1857
1858
1859
1860
# File 'lib/active_record/connection_adapters/ibm_db_pstmt.rb', line 1854

def prepared_select_with_query_cache(sql_param_hash, name = nil)
  if @query_cache_enabled
    cache_sql("#{sql_param_hash["sqlSegment"]} #{sql_param_hash["paramArray"]}") { prepared_select_without_query_cache(sql_param_hash, name) }
  else
    prepared_select_without_query_cache(sql_param_hash, name)
  end
end