prosopite 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c01f842ae2f77f85afad80b9333d9e08532763b0a2f4da8b947fd224bd8ad5e
4
- data.tar.gz: b7355dba60a61af1936fabc438838cd6c5e68c2bf99ad4f89250f0fbb56da6f7
3
+ metadata.gz: faaeeb7c0908320a1eade29fde52c959c756f30d390bf3251427aca0d5737ea4
4
+ data.tar.gz: 9843d2c7d5991d992299197b5121a68adc8cd8bc0ba7f4878f89e6eba1c00565
5
5
  SHA512:
6
- metadata.gz: d667f984caa2c358dd1268a515d4784bad98d86c39f42535cc97c7161c5f9131dbdf8dd57786aebc6fc20b55d1fcc660f4700260db08e47df3400797e4f7e3da
7
- data.tar.gz: 1b31e428871d38f29fb3f46f1c637cc822addbc5c826366da5b98ebe149bc1af63912f69a8a50cec277ed8e2c34c185bdc11e3f58d302a43fedd97c5b20622cc
6
+ metadata.gz: a6e47da136f7e071d1d5466ee2e60fc6f571e8c129ca3f4331a200398b824891ec4dbdadcc7e244f2f51957df386aa3b20bf2b5b7e84a77510e64a3cba6fd465
7
+ data.tar.gz: b53e5014b44e8fbef56088cb15e4a6cbf1fc4e596316425cc1c5ce0a09eda29b9aa98ea94900eb3be3c2772bb0c77b7a4433f2650119ef20e4125718a3b8e812
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- prosopite (1.0.1)
4
+ prosopite (1.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Prosopite
4
- VERSION = "1.0.2"
4
+ VERSION = "1.0.3"
5
5
  end
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
- if fingerprints.uniq.size == 1 && !kaller.any? { |f| @allow_list.any? { |s| f.include?(s) } }
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prosopite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mpampis Kostas