bullet 4.11.0 → 4.12.0
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 +4 -4
- data/CHANGELOG.md +10 -1
- data/Gemfile.mongoid-4.0 +1 -1
- data/Gemfile.rails-3.2 +1 -1
- data/Gemfile.rails-4.0 +1 -1
- data/Gemfile.rails-4.1 +1 -1
- data/README.md +52 -46
- data/bullet.gemspec +2 -2
- data/lib/bullet/active_record3.rb +1 -1
- data/lib/bullet/active_record3x.rb +1 -1
- data/lib/bullet/active_record4.rb +1 -11
- data/lib/bullet/active_record41.rb +1 -0
- data/lib/bullet/detector/association.rb +13 -7
- data/lib/bullet/detector/counter_cache.rb +11 -11
- data/lib/bullet/detector/n_plus_one_query.rb +28 -18
- data/lib/bullet/detector/unused_eager_loading.rb +16 -16
- data/lib/bullet/ext/object.rb +8 -4
- data/lib/bullet/notification/base.rb +5 -5
- data/lib/bullet/rack.rb +1 -1
- data/lib/bullet/registry/object.rb +4 -4
- data/lib/bullet/version.rb +1 -1
- data/lib/bullet.rb +5 -2
- data/spec/bullet/detector/association_spec.rb +2 -2
- data/spec/bullet/detector/counter_cache_spec.rb +8 -8
- data/spec/bullet/detector/n_plus_one_query_spec.rb +27 -27
- data/spec/bullet/detector/unused_eager_loading_spec.rb +15 -15
- data/spec/bullet/ext/object_spec.rb +17 -3
- data/spec/bullet/notification/base_spec.rb +37 -0
- data/spec/bullet/registry/object_spec.rb +4 -4
- data/spec/bullet_spec.rb +2 -2
- data/spec/integration/active_record3/association_spec.rb +2 -2
- data/spec/integration/active_record4/association_spec.rb +1 -1
- data/spec/models/category.rb +1 -1
- data/spec/models/post.rb +1 -1
- data/spec/spec_helper.rb +2 -2
- data/spec/support/bullet_ext.rb +1 -1
- metadata +6 -6
data/spec/models/category.rb
CHANGED
data/spec/models/post.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
|
@@ -65,7 +65,7 @@ if active_record?
|
|
|
65
65
|
end
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
-
if ENV["
|
|
68
|
+
if ENV["BULLET_LOG"]
|
|
69
69
|
require 'logger'
|
|
70
70
|
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
|
71
71
|
end
|
|
@@ -96,7 +96,7 @@ if mongoid?
|
|
|
96
96
|
end
|
|
97
97
|
end
|
|
98
98
|
|
|
99
|
-
if ENV["
|
|
99
|
+
if ENV["BULLET_LOG"]
|
|
100
100
|
Mongoid.logger = Logger.new(STDOUT)
|
|
101
101
|
Moped.logger = Logger.new(STDOUT)
|
|
102
102
|
end
|
data/spec/support/bullet_ext.rb
CHANGED
|
@@ -33,7 +33,7 @@ module Bullet
|
|
|
33
33
|
|
|
34
34
|
# returns true if a given object has a specific association
|
|
35
35
|
def creating_object_association_for?(object, association)
|
|
36
|
-
object_associations[object.
|
|
36
|
+
object_associations[object.bullet_key].present? && object_associations[object.bullet_key].include?(association)
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
# returns true if a given class includes the specific unpreloaded association
|
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: 4.
|
|
4
|
+
version: 4.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Richard Huang
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-07-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -16,26 +16,26 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
19
|
+
version: 3.0.0
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
26
|
+
version: 3.0.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: uniform_notifier
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: 1.6.0
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- - "
|
|
38
|
+
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: 1.6.0
|
|
41
41
|
description: help to kill N+1 queries and unused eager loading.
|