I have two Models in my Rails 6 / PostgreSQL application which have a many to many relation;
Driver. The goal is to get all records (Cars) which have no association at all (Drivers). At the moment this is done using Ruby (2.6.3) like this:
result =  Car.all.each do |car| result << car.id if car.drivers.empty? end
Is there an ActiveRecord expression which avoids instantiating each record?