-
Type: Improvement
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: Query
-
None
-
Minor Change
lib/mongoid/association/referenced/has_and_belongs_to_many.rb has this code:
crit = relation_class.all_of(primary_key => {"$in" => id_list || []})
When id_list is empty, it seems to me this criteria should be replaced with an instance of None to avoid an unsatisfiable database query.