Comments (4)
Hi, bullet gem can really handle deep eager loading. But I need more information to confirm what's wrong. Can you give me some description that can reproduce the error?
from bullet.
I can't build a test case that works outside our code at the moment, but the basic issue is this. We have "locations", "hotels", and "deals" as the 3 basic objects that represent this issue. A location corresponds to a city, a hotel a hotel, and a deal is our hotel deal info.
In the code, a location has_many hotels, a hotel belongs_to a location, and then hotels has_many deals, and a deal belongs_to a hotel. Oh, and deal has_one location through hotel.
What happens is that when I go to a page that lists deals, Bullet would say that my deal load needs to include hotel (as per the first part I mention in my original message/issue. So, I add that. Then, when I view that page again, Bullet says I need to do an include for the location on hotel. This is where I then change the include on deal, to be a deep include for hotel with its location (the second include line I show in the original issue message). However, Bullet than reverts back to its original message saying that that new include I added is unused, and that I need to do the ":include => [:hotel]" part for a deal.
It is possible I'm loading hotels in some other aspect, but I haven't seen that. I'm not overly worried about it right now, but brought up the issue as I was confused by the Bullet reporting.
from bullet.
I have added a test especially for this issue. You can find it in spec/bullet/association_for_chris_spec.rb
. Do you think it is what you did?
You can checkout the codes and run rake spec SPEC=spec/bullet/association_for_chris_spec.rb
, but there are no failed tests yet.
You can change the test anyway and make them failed, then I can fix these failed tests.
from bullet.
I submitted a bug for a similar issue before I saw this one. I think this has to do with using partials.
from bullet.
Related Issues (20)
- Support for mongoid 8.0
- Missing tests for eager_load
- Request to create new tag for current master HOT 1
- Using Bullet With Sidekiq Worker Middleware HOT 3
- No such middleware to insert before: ActionDispatch::ContentSecurityPolicy::Middleware (RuntimeError) HOT 1
- Undefined method include? for Rails::Configuration::MiddlewareStackProxy after upgrading to 7.0.6 HOT 5
- False "AVOID eager loading detected" on model association
- False positive with count associtiaons HOT 4
- Comparison with prospite and Rails strict_loading
- Suppress messages for impossible JOINS across multiple databases?
- Include in test as well?
- Too many allocations when using Bullet >= 7.0.5
- Why sentry not received alert when n+1 query detected in staging env ?
- Content Security Policy not properly detected in Rails HOT 4
- 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
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.