flyerhzm / bullet

help to kill N+1 queries and unused eager loading

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

False positive on rails7

alec-c4 opened this issue · comments

Hey!
I've developed rails app templates to use with rails7, but I have a false positive on some controllers. How to reproduce:

  • install any version from https://github.com/alec-c4/kickstart as described in readme
  • add secrets, as described in readme
  • start an app and register as a new user
  • from rails console - User.first.add_role :admin
  • open application http://localhost:3000/admin and open user management
  • try to add role "beta" and you'll see a warning about N+1

But, if you check app/controllers/admin/users_controller.rb - you'll see that there's preloading for roles

  def set_user
    @user = User.includes([:login_activities, :roles], avatar_attachment: :blob).find(params[:id])
  end

What's wrong with it?

@alec-c4 it's fixed, please upgrade bullet to 7.0.1