mongoid/mongoid — Issue #1564: avoiding storing empty arrays in has_and_belongs_to_many relations
Author: fbjork
Created: 2012-01-08 03:25:35+00:00
State: open

Is there an option to pass in to has_and_belongs_to_many to avoid inserting empty arrays? The field it self could in fact be omitted altogether if there's no value assigned to it.

Our current solution is to use an Array field and avoid the association altogether.