Skip to content

Eager loading and N + 1 issue #2928

@iSarCasm

Description

@iSarCasm

I have two models:

class ActiveTour < ApplicationRecord
  ...
  rails_admin do
    edit do
      field :tour_hotels do
        eager_load true
      end
    end
  end
  ...
class TourHotel < ApplicationRecord
  ..
  rails_admin do
    edit do
      field :hotel do
        eager_load true
      end
    end
  end
  ...
end

When I access http://localhost:3000/admin/active_tour/4/edit I get the bullet warning saying: USE eager loading detected TourHotel => [:hotel] Add to your finder: :includes => [:hotel]

How can I fix this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions