mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
select goes through exec(), so no method chaining for query counts
This commit is contained in:
parent
5c6978608d
commit
6367e95867
1 changed files with 0 additions and 12 deletions
|
@ -33,15 +33,3 @@ ActiveRecord::Base.configurations = {
|
|||
ActiveRecord::Base.establish_connection 'arunit'
|
||||
Course.establish_connection 'arunit2'
|
||||
|
||||
# for assert_queries test helper
|
||||
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, binds = [])
|
||||
$queries_executed ||= []
|
||||
$queries_executed << sql unless IGNORED_SELECT_SQL.any? { |r| sql =~ r }
|
||||
select_without_query_record(sql, name, binds)
|
||||
end
|
||||
|
||||
alias_method_chain :select, :query_record
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue