Class: ActiveRecord::ConnectionAdapters::JdbcAdapter

Inherits:
AbstractAdapter show all
Defined in:
lib/activerecord_execute_raw/execute_raw.rb

Overview

then override the base method on the JdbcAdapter

Instance Method Summary collapse

Instance Method Details

#execute_raw(sql, name = nil) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/activerecord_execute_raw/execute_raw.rb', line 17

def execute_raw(sql, name = nil)
  log(sql, name) do
    if ActiveRecord::ConnectionAdapters::JdbcConnection::select?(sql)
      @connection.execute_query(sql)
    else
      @connection.execute_update(sql)
    end
  end
end