File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
lib/ar_query_matchers/queries Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 1- 0.9.1
1+ 0.9.2
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ def self.instrument(&block)
1717 class LoadQueryFilter < Queries ::QueryFilter
1818 # Matches named SQL operations like the following:
1919 # 'User Load'
20- MODEL_LOAD_PATTERN = /\A (?<field_name >[\w :]+)/
20+ MODEL_LOAD_PATTERN = /\A (?<model_name >[\w :]+) (Load|Exists) \Z /
2121
2222 # Matches unnamed SQL operations like the following:
2323 # "SELECT COUNT(*) FROM `users` ..."
@@ -27,7 +27,7 @@ def filter_map(name, sql)
2727 # First check for a `SELECT * FROM` query that ActiveRecord has
2828 # helpfully named for us in the payload
2929 match = name . match ( MODEL_LOAD_PATTERN )
30- return ModelName . new ( match [ :model_name ] ) if match &. names &. include? :model_name
30+ return ModelName . new ( match [ :model_name ] ) if match
3131
3232 # Fall back to pattern-matching on the table name in a COUNT and looking
3333 # up the table name from ActiveRecord's loaded descendants.
You can’t perform that action at this time.
0 commit comments