bullet 5.4.2 → 5.4.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
  SHA1:
3
- metadata.gz: a2e6c4a9a98e1cf85620eeafb1d6feadc997c785
4
- data.tar.gz: 520006e52a1880e2209e488c2d0a5013ca86a5d4
3
+ metadata.gz: db91b963b462abea2bcc844e823be6844b6e9619
4
+ data.tar.gz: 53743afe0b49e9cb886ab14f1fd486c1545aa9fb
5
5
  SHA512:
6
- metadata.gz: 2322a95010d451bb1c8f8328db39de6c14b2bd5d6136117bf6df04d7b0446ce0d6f5d05646583391a1245675a06d4274d4e8b70b1f949c8e0cf337ca357f173c
7
- data.tar.gz: e0c76d61753a3f3b8d898d3f22b6948a3cc51ca36c88b2bcdd816d6330b3262bc2621876813fac62e28de7e6ca1f3c77d56ceeb8dbea7261af91373f81885923
6
+ metadata.gz: 3b5d3790ae95fd828af2bd4ce1c4b964ec906e1d2caf8a4220e9757f8e0a192af2078a1a2f4e2704b3700eed8f43f4fcb1d0e7638a3a47aa81dfeaf42f535384
7
+ data.tar.gz: 048266edcde0343713b05d3b726ecb318340c9d2e382877b1e697549b185f164933ba3761c10b2b2f991c1d9638b1f5a119e6bb8738f4da6034b6ed949e2a565
@@ -1,5 +1,9 @@
1
1
  # Next Release
2
2
 
3
+ ## 5.4.3
4
+
5
+ * Fix "false alert" in rails 5 #239
6
+
3
7
  ## 5.4.2
4
8
 
5
9
  * Fix "display http request method" #311
data/README.md CHANGED
@@ -332,7 +332,7 @@ model: Post => associations: [comment]
332
332
 
333
333
  which means there is a N+1 query from the Post object to its Comment association.
334
334
 
335
- In the meanwhile, there's a log appended into `log/bullet.log` file
335
+ In the meantime, there's a log appended into `log/bullet.log` file
336
336
 
337
337
  ```
338
338
  2010-03-07 14:12:18[INFO] N+1 Query in /posts
@@ -11,8 +11,13 @@ module Bullet
11
11
  result = origin_find_by_sql(sql)
12
12
  if Bullet.start?
13
13
  if result.is_a? Array
14
- Bullet::Detector::NPlusOneQuery.add_possible_objects(result)
15
- Bullet::Detector::CounterCache.add_possible_objects(result)
14
+ if result.size > 1
15
+ Bullet::Detector::NPlusOneQuery.add_possible_objects(result)
16
+ Bullet::Detector::CounterCache.add_possible_objects(result)
17
+ elsif result.size == 1
18
+ Bullet::Detector::NPlusOneQuery.add_impossible_object(result.first)
19
+ Bullet::Detector::CounterCache.add_impossible_object(result.first)
20
+ end
16
21
  elsif result.is_a? ::ActiveRecord::Base
17
22
  Bullet::Detector::NPlusOneQuery.add_impossible_object(result)
18
23
  Bullet::Detector::CounterCache.add_impossible_object(result)
@@ -9,8 +9,13 @@ module Bullet
9
9
  result = origin_find_by_sql(sql, binds)
10
10
  if Bullet.start?
11
11
  if result.is_a? Array
12
- Bullet::Detector::NPlusOneQuery.add_possible_objects(result)
13
- Bullet::Detector::CounterCache.add_possible_objects(result)
12
+ if result.size > 1
13
+ Bullet::Detector::NPlusOneQuery.add_possible_objects(result)
14
+ Bullet::Detector::CounterCache.add_possible_objects(result)
15
+ elsif result.size == 1
16
+ Bullet::Detector::NPlusOneQuery.add_impossible_object(result.first)
17
+ Bullet::Detector::CounterCache.add_impossible_object(result.first)
18
+ end
14
19
  elsif result.is_a? ::ActiveRecord::Base
15
20
  Bullet::Detector::NPlusOneQuery.add_impossible_object(result)
16
21
  Bullet::Detector::CounterCache.add_impossible_object(result)
@@ -9,8 +9,13 @@ module Bullet
9
9
  result = origin_find_by_sql(sql, binds)
10
10
  if Bullet.start?
11
11
  if result.is_a? Array
12
- Bullet::Detector::NPlusOneQuery.add_possible_objects(result)
13
- Bullet::Detector::CounterCache.add_possible_objects(result)
12
+ if result.size > 1
13
+ Bullet::Detector::NPlusOneQuery.add_possible_objects(result)
14
+ Bullet::Detector::CounterCache.add_possible_objects(result)
15
+ elsif result.size == 1
16
+ Bullet::Detector::NPlusOneQuery.add_impossible_object(result.first)
17
+ Bullet::Detector::CounterCache.add_impossible_object(result.first)
18
+ end
14
19
  elsif result.is_a? ::ActiveRecord::Base
15
20
  Bullet::Detector::NPlusOneQuery.add_impossible_object(result)
16
21
  Bullet::Detector::CounterCache.add_impossible_object(result)
@@ -9,8 +9,13 @@ module Bullet
9
9
  result = origin_find_by_sql(sql, binds)
10
10
  if Bullet.start?
11
11
  if result.is_a? Array
12
- Bullet::Detector::NPlusOneQuery.add_possible_objects(result)
13
- Bullet::Detector::CounterCache.add_possible_objects(result)
12
+ if result.size > 1
13
+ Bullet::Detector::NPlusOneQuery.add_possible_objects(result)
14
+ Bullet::Detector::CounterCache.add_possible_objects(result)
15
+ elsif result.size == 1
16
+ Bullet::Detector::NPlusOneQuery.add_impossible_object(result.first)
17
+ Bullet::Detector::CounterCache.add_impossible_object(result.first)
18
+ end
14
19
  elsif result.is_a? ::ActiveRecord::Base
15
20
  Bullet::Detector::NPlusOneQuery.add_impossible_object(result)
16
21
  Bullet::Detector::CounterCache.add_impossible_object(result)
@@ -24,8 +24,13 @@ module Bullet
24
24
  result = origin_find_by_sql(sql, binds)
25
25
  if Bullet.start?
26
26
  if result.is_a? Array
27
- Bullet::Detector::NPlusOneQuery.add_possible_objects(result)
28
- Bullet::Detector::CounterCache.add_possible_objects(result)
27
+ if result.size > 1
28
+ Bullet::Detector::NPlusOneQuery.add_possible_objects(result)
29
+ Bullet::Detector::CounterCache.add_possible_objects(result)
30
+ elsif result.size == 1
31
+ Bullet::Detector::NPlusOneQuery.add_impossible_object(result.first)
32
+ Bullet::Detector::CounterCache.add_impossible_object(result.first)
33
+ end
29
34
  elsif result.is_a? ::ActiveRecord::Base
30
35
  Bullet::Detector::NPlusOneQuery.add_impossible_object(result)
31
36
  Bullet::Detector::CounterCache.add_impossible_object(result)
@@ -25,8 +25,13 @@ module Bullet
25
25
  result = origin_find_by_sql(sql, binds, preparable: nil)
26
26
  if Bullet.start?
27
27
  if result.is_a? Array
28
- Bullet::Detector::NPlusOneQuery.add_possible_objects(result)
29
- Bullet::Detector::CounterCache.add_possible_objects(result)
28
+ if result.size > 1
29
+ Bullet::Detector::NPlusOneQuery.add_possible_objects(result)
30
+ Bullet::Detector::CounterCache.add_possible_objects(result)
31
+ elsif result.size == 1
32
+ Bullet::Detector::NPlusOneQuery.add_impossible_object(result.first)
33
+ Bullet::Detector::CounterCache.add_impossible_object(result.first)
34
+ end
30
35
  elsif result.is_a? ::ActiveRecord::Base
31
36
  Bullet::Detector::NPlusOneQuery.add_impossible_object(result)
32
37
  Bullet::Detector::CounterCache.add_impossible_object(result)
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Bullet
3
- VERSION = "5.4.2"
3
+ VERSION = "5.4.3"
4
4
  end
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.4.2
4
+ version: 5.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-27 00:00:00.000000000 Z
11
+ date: 2016-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport