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.
@@ -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 encounter the following errors in development environment:
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 plugin
215
+ 5. add bullet gem to <code>Gemfile</code>
228
216
 
229
217
  <pre><code>
230
- $ script/plugin install git://github.com/flyerhzm/bullet.git
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
- 2009-08-20 09:12:19[INFO] N+1 Query: PATH_INFO: /posts; model: Post => assocations: [comments]
268
- Add your finder: :include => [:comments]
269
- 2009-08-20 09:12:19[INFO] N+1 Query: method call stack:
270
- /Users/richard/Downloads/test/app/views/posts/index.html.erb:11:in `_run_erb_app47views47posts47index46html46erb'
271
- /Users/richard/Downloads/test/app/views/posts/index.html.erb:8:in `each'
272
- /Users/richard/Downloads/test/app/views/posts/index.html.erb:8:in `_run_erb_app47views47posts47index46html46erb'
273
- /Users/richard/Downloads/test/app/controllers/posts_controller.rb:7:in `index'
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.find(:all)
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
1
+ 2.0.0.beta.2
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bullet}
8
- s.version = "2.0.0.beta.1"
8
+ s.version = "2.0.0.beta.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Richard Huang"]
@@ -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
- callers << caller.select {|c| c =~ /#{Rails.root}/}.reject {|c| c =~ /#{VENDOR_ROOT}/}
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
 
metadata CHANGED
@@ -7,8 +7,8 @@ version: !ruby/object:Gem::Version
7
7
  - 0
8
8
  - 0
9
9
  - beta
10
- - 1
11
- version: 2.0.0.beta.1
10
+ - 2
11
+ version: 2.0.0.beta.2
12
12
  platform: ruby
13
13
  authors:
14
14
  - Richard Huang