bullet 2.0.0.beta.1 → 2.0.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +16 -23
- data/VERSION +1 -1
- data/bullet.gemspec +1 -1
- data/lib/bullet/association.rb +2 -2
- metadata +2 -2
data/README.textile
CHANGED
@@ -107,19 +107,7 @@ ruby-growl gem has an issue about md5 in ruby 1.9, if you use growl and ruby 1.9
|
|
107
107
|
|
108
108
|
h2. Important
|
109
109
|
|
110
|
-
If you
|
111
|
-
|
112
|
-
<pre><code>
|
113
|
-
You might have expected an instance of Array.
|
114
|
-
The error occurred while evaluating nil.include?
|
115
|
-
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:142:in `create_time_zone_conversion_attribute?'
|
116
|
-
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:75:in `define_attribute_methods'
|
117
|
-
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:71:in `each'
|
118
|
-
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:71:in `define_attribute_methods'
|
119
|
-
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:242:in `method_missing'
|
120
|
-
</code></pre>
|
121
|
-
|
122
|
-
Or any strange behavior of bullet plugin/gem, *please disable your browser's cache*.
|
110
|
+
If you find bullet does not work for you, *please disable your browser's cache*.
|
123
111
|
|
124
112
|
****************************************************************************
|
125
113
|
|
@@ -224,12 +212,16 @@ post2.comments.create(:name => 'fourth')
|
|
224
212
|
<% end %>
|
225
213
|
</code></pre>
|
226
214
|
|
227
|
-
5. add bullet
|
215
|
+
5. add bullet gem to <code>Gemfile</code>
|
228
216
|
|
229
217
|
<pre><code>
|
230
|
-
|
218
|
+
gem "bullet", "2.0.0.beta.2"
|
231
219
|
</code></pre>
|
232
220
|
|
221
|
+
And run
|
222
|
+
|
223
|
+
<pre><code>bundle install</code></pre>
|
224
|
+
|
233
225
|
6. enable the bullet plugin in development, add a line to <code>config/environments/development.rb</code>
|
234
226
|
|
235
227
|
<pre><code>
|
@@ -264,13 +256,14 @@ which means there is a N+1 query from post object to comments associations.
|
|
264
256
|
In the meanwhile, there's a log appended into <code>log/bullet.log</code> file
|
265
257
|
|
266
258
|
<pre><code>
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
/
|
272
|
-
/
|
273
|
-
/
|
259
|
+
2010-03-07 14:12:18[INFO] N+1 Query in /posts
|
260
|
+
Post => [:comments]
|
261
|
+
Add to your finder: :include => [:comments]
|
262
|
+
2010-03-07 14:12:18[INFO] N+1 Query method call stack
|
263
|
+
/home/flyerhzm/NetBeansProjects/test_bullet2/app/views/posts/index.html.erb:14:in `_render_template__600522146_80203160_0'
|
264
|
+
/home/flyerhzm/NetBeansProjects/test_bullet2/app/views/posts/index.html.erb:11:in `each'
|
265
|
+
/home/flyerhzm/NetBeansProjects/test_bullet2/app/views/posts/index.html.erb:11:in `_render_template__600522146_80203160_0'
|
266
|
+
/home/flyerhzm/NetBeansProjects/test_bullet2/app/controllers/posts_controller.rb:7:in `index'
|
274
267
|
</code></pre>
|
275
268
|
|
276
269
|
The generated SQLs are
|
@@ -350,7 +343,7 @@ Remove from your finder: :include => [:comments]
|
|
350
343
|
|
351
344
|
<pre><code>
|
352
345
|
def index
|
353
|
-
@posts = Post.
|
346
|
+
@posts = Post.all
|
354
347
|
|
355
348
|
respond_to do |format|
|
356
349
|
format.html # index.html.erb
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.0.beta.
|
1
|
+
2.0.0.beta.2
|
data/bullet.gemspec
CHANGED
data/lib/bullet/association.rb
CHANGED
@@ -280,9 +280,9 @@ module Bullet
|
|
280
280
|
@@eager_loadings ||= {}
|
281
281
|
end
|
282
282
|
|
283
|
-
VENDOR_ROOT = File.join(Rails.root, 'vendor')
|
284
283
|
def caller_in_project
|
285
|
-
|
284
|
+
vender_root ||= File.join(Rails.root, 'vendor')
|
285
|
+
callers << caller.select {|c| c =~ /#{Rails.root}/}.reject {|c| c =~ /#{vender_root}/}
|
286
286
|
callers.uniq!
|
287
287
|
end
|
288
288
|
|