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



1910
1911
1912
1913
1914
# File 'lib/active_record/connection_adapters/ibm_db_pstmt.rb', line 1910

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



1917
1918
1919
1920
1921
1922
1923
# File 'lib/active_record/connection_adapters/ibm_db_pstmt.rb', line 1917

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