moiristo / deep_cloneable

This gem gives every ActiveRecord::Base object the possibility to do a deep clone that includes user specified associations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clone to different model

t56k opened this issue · comments

Does this gem support the option to clone a set of children to a different model?

Say a Template has many Frames, and Frames have many FrameVariables. Can I clone those Frames and FrameVariables to a new Document?

No, there's no support to do that yet. As the copy is not saved, you could make a copy of the template first and then reattach the duplicated frames to the document afterwards instead.

@t56k how did you go about this? I am working on the same thing. It doesn't seem we would even need this gem if we have to go through setting attributes manually anyways.