how to eager load a has_and_belongs_to_many association in mongoid?

35 Views Asked by At

I have a habtm association in a rails app using mongo / mongoid

class A
    has_and_belongs_to_many :bs, inverse_of: :as
end

class B
    has_and_belongs_to_many :as, inverse_of: :bs
end

and i want to

 A.where(...).includes(:bs)

but i get an error

 undefined method 'b_ids'

Is there a way to eager load habtms?

Thanks, Kevin

0

There are 0 best solutions below