Methods
Instance Public methods
test_explain_for_one_query()
Link
# File activerecord/test/cases/adapters/mysql2/explain_test.rb, line 10 def test_explain_for_one_query explain = Developer.where(:id => 1).explain assert_match %Q(EXPLAIN for: SELECT `developers`.* FROM `developers` WHERE `developers`.`id` = 1), explain assert_match %Q(developers | const), explain end
test_explain_with_eager_loading()
Link
# File activerecord/test/cases/adapters/mysql2/explain_test.rb, line 16 def test_explain_with_eager_loading explain = Developer.where(:id => 1).includes(:audit_logs).explain assert_match %Q(EXPLAIN for: SELECT `developers`.* FROM `developers` WHERE `developers`.`id` = 1), explain assert_match %Q(developers | const), explain assert_match %Q(EXPLAIN for: SELECT `audit_logs`.* FROM `audit_logs` WHERE `audit_logs`.`developer_id` IN (1)), explain assert_match %Q(audit_logs | ALL), explain end