Skip to content

Commit 33b31c5

Browse files
fatkodimabyroot
authored andcommitted
Fix :source_location query tag option to print full source locations
1 parent e63b83b commit 33b31c5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

activerecord/lib/active_record/query_logs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def clear_cache # :nodoc:
154154

155155
def query_source_location # :nodoc:
156156
Thread.each_caller_location do |location|
157-
frame = LogSubscriber.backtrace_cleaner.clean_frame(location.path)
157+
frame = LogSubscriber.backtrace_cleaner.clean_frame(location)
158158
return frame if frame
159159
end
160160
nil

railties/test/application/query_logs_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def app
163163
get "/", {}, { "HTTPS" => "on" }
164164
comment = last_response.body.strip
165165

166-
assert_match(/source_location='.*'/, comment)
166+
assert_match(/source_location='.*\d+'/, comment)
167167
end
168168

169169
test "controller tags are not doubled up if already configured" do

0 commit comments

Comments
 (0)