diff options
author | kennyj <kennyj@gmail.com> | 2012-09-16 10:43:30 +0900 |
---|---|---|
committer | kennyj <kennyj@gmail.com> | 2012-09-17 00:22:34 +0900 |
commit | 5bb056d268c9fc8c08c04ef04aef0c499b08a12c (patch) | |
tree | dcf5a5ca4516a996bb5b78bd4d79b66ba3aeae9e /activerecord/test | |
parent | 761bc751d31c22e2c2fdae2b4cdd435b68b6d783 (diff) | |
download | rails-5bb056d268c9fc8c08c04ef04aef0c499b08a12c.tar.gz rails-5bb056d268c9fc8c08c04ef04aef0c499b08a12c.tar.bz2 rails-5bb056d268c9fc8c08c04ef04aef0c499b08a12c.zip |
Don't explain except normal CRUD sql.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/explain_subscriber_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/explain_subscriber_test.rb b/activerecord/test/cases/explain_subscriber_test.rb index 91e1df91cd..b425967678 100644 --- a/activerecord/test/cases/explain_subscriber_test.rb +++ b/activerecord/test/cases/explain_subscriber_test.rb @@ -38,6 +38,13 @@ if ActiveRecord::Base.connection.supports_explain? end end + def test_collects_nothing_if_unexplained_sqls + with_queries([]) do |queries| + SUBSCRIBER.finish(nil, nil, :name => 'SQL', :sql => 'SHOW max_identifier_length') + assert queries.empty? + end + end + def with_queries(queries) Thread.current[:available_queries_for_explain] = queries yield queries |