aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/log_subscriber.rb
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-04-14 18:22:43 -0700
committerJohn Hawthorn <john@hawthorn.email>2019-04-15 16:13:06 -0700
commit0bab6310d623f9f8ed382c93ddeb9f4d1a0b8f75 (patch)
tree7ec9d96b3c4bcfcc903030b9909b506d80d6f7cc /activerecord/lib/active_record/log_subscriber.rb
parent60afbfffdcdb4510deccf8d6db303dd4260e3dc7 (diff)
downloadrails-0bab6310d623f9f8ed382c93ddeb9f4d1a0b8f75.tar.gz
rails-0bab6310d623f9f8ed382c93ddeb9f4d1a0b8f75.tar.bz2
rails-0bab6310d623f9f8ed382c93ddeb9f4d1a0b8f75.zip
Find query_source_location using lazy Enumerator
This way, we only need to filter the backtrace up to the first non-noise stack frame. This also updates noise to be able to deal with being passed a lazy enum. We don't need this anywhere, but it seemed better for this to be consistent.
Diffstat (limited to 'activerecord/lib/active_record/log_subscriber.rb')
-rw-r--r--activerecord/lib/active_record/log_subscriber.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/log_subscriber.rb b/activerecord/lib/active_record/log_subscriber.rb
index 6b84431343..6248c2f578 100644
--- a/activerecord/lib/active_record/log_subscriber.rb
+++ b/activerecord/lib/active_record/log_subscriber.rb
@@ -110,7 +110,7 @@ module ActiveRecord
end
def extract_query_source_location(locations)
- backtrace_cleaner.clean(locations).first
+ backtrace_cleaner.clean(locations.lazy).first
end
end
end