mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
use bind params in select with query monkeypatch
This commit is contained in:
@@ -37,10 +37,10 @@ Course.establish_connection 'arunit2'
|
||||
ActiveRecord::Base.connection.class.class_eval do
|
||||
IGNORED_SELECT_SQL = [/^select .*nextval/i, /^SAVEPOINT/, /^ROLLBACK TO/, /^\s*select .* from ((all|user)_tab_columns|(all|user)_triggers|(all|user)_constraints)/im]
|
||||
|
||||
def select_with_query_record(sql, name = nil)
|
||||
def select_with_query_record(sql, name = nil, binds = [])
|
||||
$queries_executed ||= []
|
||||
$queries_executed << sql unless IGNORED_SELECT_SQL.any? { |r| sql =~ r }
|
||||
select_without_query_record(sql, name)
|
||||
select_without_query_record(sql, name, binds)
|
||||
end
|
||||
|
||||
alias_method_chain :select, :query_record
|
||||
|
||||
Reference in New Issue
Block a user