Skip to content

Commit bc00484

Browse files
committed
No need to check if the logs are enable to run those tests
1 parent ac77ab4 commit bc00484

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

activerecord/test/cases/query_logs_test.rb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@ class QueryLogsTest < ActiveRecord::TestCase
1111
}
1212

1313
def setup
14-
@original_enabled = ActiveRecord.query_log_tags_enabled
15-
ActiveRecord.query_log_tags_enabled = true
16-
if @original_enabled == false
17-
# if we haven't enabled the feature, the execution methods need to be prepended at run time
18-
ActiveRecord::Base.connection.class_eval do
19-
prepend(ActiveRecord::QueryLogs::ExecutionMethods)
20-
end
14+
# Enable the query tags logging
15+
ActiveRecord::Base.connection.class_eval do
16+
prepend(ActiveRecord::QueryLogs::ExecutionMethods)
2117
end
2218
@original_prepend = ActiveRecord::QueryLogs.prepend_comment
2319
ActiveRecord::QueryLogs.prepend_comment = false
@@ -26,7 +22,6 @@ def setup
2622
end
2723

2824
def teardown
29-
ActiveRecord.query_log_tags_enabled = @original_enabled
3025
ActiveRecord::QueryLogs.prepend_comment = @original_prepend
3126
ActiveRecord::QueryLogs.tags = []
3227
end

0 commit comments

Comments
 (0)