Closed alessandromacagno closed 4 years ago
Hey! Can you try to load tags from a persisted record, please?
a = FactoryBot.create(:a, :with_tags)
a.tag_mappings # => <TagMapping owner_id: 1, owner_type: A, tag_id: 1>
a.tags # => <Tag id: 1>
operation = ACloner.call(a)
operation.persist # => true
cloned_a = operation.to_record.reload
cloned_a.tags # => ?
cloned_a.tag_mappings # => ?
Thank @ssnickolay for your super fast response and solution. It works perfectly!
Hi guys!
First of all congrats for your awesome gem. I'm opening an issue because I didn't find anywhere documentation for polymorphic tables, and I think the current behaviour is not as intended.
Example to reproduce. The table tag mapping has a polymorphic field owner (owner_id and owner_type)
Cloner
rails console
My workaround is:
Thank you :-)