bullet 5.7.3 → 5.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/bullet/mongoid6x.rb +4 -2
- data/lib/bullet/stack_trace_filter.rb +16 -2
- data/lib/bullet/version.rb +1 -1
- data/spec/support/mongo_seed.rb +1 -1
- data/spec/support/sqlite_seed.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dc58f03ac00764a73d88e5687a32895d94abcac
|
4
|
+
data.tar.gz: bd8d3b6215063a5536489aeaab2ffbdc72cb85e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c19ffb78e51f2307ce792759149e67a8f354db648b1aa0a0a746c5153c2337596ca067bbec8ed12df536bb455502438df50fc23dce1c05c1595e31b488ff1c33
|
7
|
+
data.tar.gz: 784d901307fbd9ba2286d6281e25229ea11e580a81b2dd7d5514a20b713faa72902d2c79ab6804d0ed93c61859cd1bb36955374b16e4101353329b318a8fa8d3
|
data/CHANGELOG.md
CHANGED
data/lib/bullet/mongoid6x.rb
CHANGED
@@ -21,13 +21,15 @@ module Bullet
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def each(&block)
|
24
|
-
|
24
|
+
return to_enum unless block_given?
|
25
|
+
records = []
|
26
|
+
origin_each { |record| records << record }
|
25
27
|
if records.length > 1
|
26
28
|
Bullet::Detector::NPlusOneQuery.add_possible_objects(records)
|
27
29
|
elsif records.size == 1
|
28
30
|
Bullet::Detector::NPlusOneQuery.add_impossible_object(records.first)
|
29
31
|
end
|
30
|
-
|
32
|
+
records.each(&block)
|
31
33
|
end
|
32
34
|
|
33
35
|
def eager_load(docs)
|
@@ -6,8 +6,7 @@ module Bullet
|
|
6
6
|
app_root = rails? ? Rails.root.to_s : Dir.pwd
|
7
7
|
vendor_root = app_root + VENDOR_PATH
|
8
8
|
bundler_path = Bundler.bundle_path.to_s
|
9
|
-
|
10
|
-
caller_path = location.absolute_path.to_s
|
9
|
+
select_caller_locations do |caller_path|
|
11
10
|
caller_path.include?(app_root) && !caller_path.include?(vendor_root) && !caller_path.include?(bundler_path) ||
|
12
11
|
Bullet.stacktrace_includes.any? do |include_pattern|
|
13
12
|
case include_pattern
|
@@ -33,5 +32,20 @@ module Bullet
|
|
33
32
|
end
|
34
33
|
end
|
35
34
|
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def select_caller_locations
|
39
|
+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
|
40
|
+
caller.select do |caller_path|
|
41
|
+
yield caller_path
|
42
|
+
end
|
43
|
+
else
|
44
|
+
caller_locations.select do |location|
|
45
|
+
caller_path = location.absolute_path.to_s
|
46
|
+
yield caller_path
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
36
50
|
end
|
37
51
|
end
|
data/lib/bullet/version.rb
CHANGED
data/spec/support/mongo_seed.rb
CHANGED
data/spec/support/sqlite_seed.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.7.
|
4
|
+
version: 5.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|