refactor assert_sql query to reuse capture_sql
set assert_sql to reuse the capture_sql method from above instead of repeating the code in response to comments on issue #14546
This commit is contained in:
parent
e9f53f7a7a
commit
49e17431ca
|
@ -26,9 +26,7 @@ module ActiveRecord
|
|||
end
|
||||
|
||||
def assert_sql(*patterns_to_match)
|
||||
SQLCounter.clear_log
|
||||
yield
|
||||
SQLCounter.log_all
|
||||
capture_sql { yield }
|
||||
ensure
|
||||
failed_patterns = []
|
||||
patterns_to_match.each do |pattern|
|
||||
|
|
Loading…
Reference in New Issue