Open somazx opened 3 years ago
Hi Andy,
Thank you for your interest! The example you specified is actually a hm-through, not habtm. I think it also exemplifies why it works like this: some would like that only new join records to the records (chickens) are created, some would like the whole association to be duplicated. When you define your habtm as a hm-through, I think you can choose between both:
# Only duplicates ownerships
@human.deep_clone(include: :ownerships)
# Duplicates ownerships AND chickens
@human.deep_clone(include: { ownerships: :chicken })
Having this issue as well. Any solutions or workarounds @somazx ?
When calling
deep_clone
withinclude
and referencing ahas_and_belongs_to_many
association - it doesn't actually make new instances of the object(s) like it does for every other association (has_many, etc).Using the test suite methods:
Is this an issue?