Comments (9)
Can you give me the source codes that how you use the submissions collection?
from bullet.
Sure thing.
There is a controller method:
def show_category
@category = Category.find_by_name(params[:category_name],
:include => {:submissions => :user},
:order => "id DESC")
end
The view contains:
<%= render :partial => 'shared/submission', :collection => @category.submissions %>
And the shared/_submission.html.erb contains:
<%= link_to submission.title, submission.url, :target => "_blank" %> submitted by <%= link_to submission.user.name, user_path(submission.user) %> on <%= submission.created_at %>
from bullet.
It seems that I can't reproduce this issue.
Can you tell me more information? What is your rails version? How many submissions belong to @category when bullet gave you the wrong notify?
from bullet.
Thanks for the fast response. Rails version is 2.3.5, bullet is 1.7.2, ruby is ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
@category.submissions had 3 rows in it when bullet gave me the notification.
from bullet.
I have add a spec spec/bullet/association_for_peschkaj_spec.rb
for you and tried to reproduce the issue, but I failed. If possible, can you change the spec code to reproduce the issue.
I guess there is some other problem cause this, not partial collection. If possible, you can give me your rails app and some stub data that I can figure out where the problem is.
Thanks
from bullet.
I will send a copy of the source, including a sqlite database, to the email address listed on your github page.
from bullet.
When I run the spec, the spec created for me passes, but Bullet::Association has_many for unused cases fails with the following:
Bullet::Association has_many for unused cases
- should not incorrectly mark associations as unused when multiple object instances (FAILED - 1)
- should not incorrectly mark associations as unused when multiple object instances different Model (FAILED - 2)
- should not have unused when small set of returned records are discarded
'Bullet::Association has_many for unused cases should not incorrectly mark associations as unused when multiple object instances' FAILED
expected unused_preload_associations_for?(Comment(id: integer, name: string, post_id: integer, author_id: integer), :post) to return true, got false
./spec/bullet/association_spec.rb:140:
'Bullet::Association has_many for unused cases should not incorrectly mark associations as unused when multiple object instances different Model' FAILED
expected unused_preload_associations_for?(Comment(id: integer, name: string, post_id: integer, author_id: integer), :author) to return true, got false
./spec/bullet/association_spec.rb:151:
Finished in 1.349615 seconds
73 examples, 2 failures
rake aborted!
Command /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I"lib" "/Library/Ruby/Gems/1.8/gems/rspec-1.2.9/bin/spec" "spec/bullet/association_for_chris_spec.rb" "spec/bullet/association_for_peschkaj_spec.rb" "spec/bullet/association_spec.rb" "spec/bullet/counter_spec.rb" failed
from bullet.
I have fixed this issue. Just upgrade to gem 1.7.3. This is because the logic of adding eager loadings has a slight error.
Thank you for providing me the source codes. And let me if the new gem works for you.
btw, the spec failures are not related to this issue.
from bullet.
Thank you, that worked perfectly.
from bullet.
Related Issues (20)
- Nonces are not applied to inline CSS styles
- Obvious N+1 query not detected in RSpec (when setup code is run before it) HOT 1
- add_safelist ignored HOT 1
- Support to rails 7.1.0.alpha HOT 3
- `skip_html_injection` as a URL query param?
- Feature request: accept lambda rather than using uniform_notifier
- Add support for notifiers which works on collections
- Wrong `Eager Loading Detected` if use `before_all` or `let_it_be` HOT 2
- Add support for Rails ActiveRecord 7.1.0 HOT 1
- After upgrading to Bullet 7.1, my Rails 6.1 tests start failing (reset_counters) HOT 2
- Rails 7.1 composite primary keys break N+1 detection
- Bullet does not support active_record 7.0.6 HOT 10
- Breaks with mongoid 8
- Problem with counter_cache_enable and raise HOT 1
- New gem version HOT 1
- How Can I Use Bullet Gem in a Thor Task Job ? HOT 1
- Bullet does not support active_record 7.1.3.2 yet HOT 1
- Setting the Bullet.enable swtich, flips the Bullet.unused_eager_loading_enable value
- False positive when `ActiveRecord::Associations::Preloader` is used
- Support for `active_record` 7.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bullet.