prosopite 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/prosopite/version.rb +1 -1
- data/lib/prosopite.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faaeeb7c0908320a1eade29fde52c959c756f30d390bf3251427aca0d5737ea4
|
4
|
+
data.tar.gz: 9843d2c7d5991d992299197b5121a68adc8cd8bc0ba7f4878f89e6eba1c00565
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6e47da136f7e071d1d5466ee2e60fc6f571e8c129ca3f4331a200398b824891ec4dbdadcc7e244f2f51957df386aa3b20bf2b5b7e84a77510e64a3cba6fd465
|
7
|
+
data.tar.gz: b53e5014b44e8fbef56088cb15e4a6cbf1fc4e596316425cc1c5ce0a09eda29b9aa98ea94900eb3be3c2772bb0c77b7a4433f2650119ef20e4125718a3b8e812
|
data/Gemfile.lock
CHANGED
data/lib/prosopite/version.rb
CHANGED
data/lib/prosopite.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
|
2
2
|
module Prosopite
|
3
|
+
DEFAULT_ALLOW_LIST = %w(active_record/associations/preloader active_record/validations/uniqueness)
|
4
|
+
|
3
5
|
class NPlusOneQueriesError < StandardError; end
|
4
6
|
class << self
|
5
7
|
attr_writer :raise,
|
@@ -64,12 +66,10 @@ module Prosopite
|
|
64
66
|
|
65
67
|
kaller = tc[:prosopite_query_caller][location_key]
|
66
68
|
|
67
|
-
|
69
|
+
is_allowed = kaller.any? { |f| @allow_list.concat(DEFAULT_ALLOW_LIST).any? { |s| f.include?(s) } }
|
70
|
+
if fingerprints.uniq.size == 1 && !is_allowed
|
68
71
|
queries = tc[:prosopite_query_holder][location_key]
|
69
|
-
|
70
|
-
unless kaller.any? { |f| f.include?('active_record/validations/uniqueness') }
|
71
|
-
tc[:prosopite_notifications][queries] = kaller
|
72
|
-
end
|
72
|
+
tc[:prosopite_notifications][queries] = kaller
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|