1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

add capture_sql method to compare sql statements and compare

Other methods compare specific patterns, this method outputs
the actual sql query that is generated.
This commit is contained in:
eileencodes 2014-03-31 19:18:04 -04:00
parent 5eb13fcaac
commit a67293638e

View file

@ -19,6 +19,12 @@ module ActiveRecord
end
end
def capture_sql
SQLCounter.clear_log
yield
SQLCounter.log_all.dup
end
def assert_sql(*patterns_to_match)
SQLCounter.clear_log
yield