bullet 1.7.6 → 2.0.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +17 -30
- data/README_for_rails2.textile +404 -0
- data/Rakefile +6 -5
- data/VERSION +1 -1
- data/bullet.gemspec +9 -6
- data/lib/bullet.rb +12 -5
- data/lib/bullet/{action_controller.rb → action_controller2.rb} +2 -1
- data/lib/bullet/{active_record.rb → active_record2.rb} +2 -1
- data/lib/bullet/active_record3.rb +113 -0
- data/lib/bullet/association.rb +2 -2
- data/lib/bullet/logger.rb +1 -1
- data/spec/bullet/association_for_chris_spec.rb +4 -4
- data/spec/bullet/association_for_peschkaj_spec.rb +1 -1
- data/spec/bullet/association_spec.rb +117 -109
- data/spec/bullet/counter_spec.rb +1 -1
- data/spec/spec.opts +0 -5
- data/spec/spec_helper.rb +7 -5
- metadata +22 -8
data/spec/bullet/counter_spec.rb
CHANGED
@@ -68,7 +68,7 @@ describe Bullet::Counter do
|
|
68
68
|
|
69
69
|
it "should not need counter cache with part of cities" do
|
70
70
|
Country.all.each do |country|
|
71
|
-
country.cities(:
|
71
|
+
country.cities.where(:name => 'first').size
|
72
72
|
end
|
73
73
|
Bullet::Counter.should_not be_need_counter_caches
|
74
74
|
end
|
data/spec/spec.opts
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require '
|
2
|
+
require 'rspec'
|
3
|
+
require 'rspec/autorun'
|
4
|
+
require 'rails'
|
3
5
|
require 'active_record'
|
4
6
|
require 'action_controller'
|
5
7
|
|
6
8
|
module Rails
|
7
|
-
|
8
|
-
|
9
|
+
class <<self
|
10
|
+
def root
|
11
|
+
File.expand_path(__FILE__).split('/')[0..-3].join('/')
|
12
|
+
end
|
9
13
|
end
|
10
14
|
end
|
11
15
|
|
12
|
-
RAILS_ROOT = File.expand_path(__FILE__).split('/')[0..-3].join('/') unless defined? RAILS_ROOT
|
13
|
-
|
14
16
|
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
|
15
17
|
require 'bullet'
|
16
18
|
Bullet.enable = true
|
metadata
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: true
|
5
|
+
segments:
|
6
|
+
- 2
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- beta
|
10
|
+
- 1
|
11
|
+
version: 2.0.0.beta.1
|
5
12
|
platform: ruby
|
6
13
|
authors:
|
7
14
|
- Richard Huang
|
@@ -21,15 +28,18 @@ extensions: []
|
|
21
28
|
|
22
29
|
extra_rdoc_files:
|
23
30
|
- README.textile
|
31
|
+
- README_for_rails2.textile
|
24
32
|
files:
|
25
33
|
- MIT-LICENSE
|
26
34
|
- README.textile
|
35
|
+
- README_for_rails2.textile
|
27
36
|
- Rakefile
|
28
37
|
- VERSION
|
29
38
|
- bullet.gemspec
|
30
39
|
- lib/bullet.rb
|
31
|
-
- lib/bullet/
|
32
|
-
- lib/bullet/
|
40
|
+
- lib/bullet/action_controller2.rb
|
41
|
+
- lib/bullet/active_record2.rb
|
42
|
+
- lib/bullet/active_record3.rb
|
33
43
|
- lib/bullet/association.rb
|
34
44
|
- lib/bullet/counter.rb
|
35
45
|
- lib/bullet/logger.rb
|
@@ -56,18 +66,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
66
|
requirements:
|
57
67
|
- - ">="
|
58
68
|
- !ruby/object:Gem::Version
|
69
|
+
segments:
|
70
|
+
- 0
|
59
71
|
version: "0"
|
60
|
-
version:
|
61
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
73
|
requirements:
|
63
|
-
- - "
|
74
|
+
- - ">"
|
64
75
|
- !ruby/object:Gem::Version
|
65
|
-
|
66
|
-
|
76
|
+
segments:
|
77
|
+
- 1
|
78
|
+
- 3
|
79
|
+
- 1
|
80
|
+
version: 1.3.1
|
67
81
|
requirements: []
|
68
82
|
|
69
83
|
rubyforge_project:
|
70
|
-
rubygems_version: 1.3.
|
84
|
+
rubygems_version: 1.3.6
|
71
85
|
signing_key:
|
72
86
|
specification_version: 3
|
73
87
|
summary: A plugin to kill N+1 queries and unused eager loading
|