Delay the addition of the associated object till after saving the current object, if the current object is new and the associated dataset requires a primary key on the current object.
# File lib/sequel/plugins/delay_add_association.rb, line 37 def add_associated_object(opts, o, *args) if opts.dataset_need_primary_key? && new? delay_validate_associated_object(opts, o) send(opts[:name]) << o after_create_hook{super(opts, o, *args)} o else super end end