Coder Social home page Coder Social logo

Comments (4)

flyerhzm avatar flyerhzm commented on June 11, 2024

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.

chris avatar chris commented on June 11, 2024

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.

flyerhzm avatar flyerhzm commented on June 11, 2024

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.

peschkaj avatar peschkaj commented on June 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.