I have a nested association where I have Rubric > Indicator > Question. In this gist you can see I step through the association correctly, then try to to clone the object and its associations. However, notice I have an empty array for klone.questions. I can do klone.indicators.first.questions and retrieve all questions associated with the first indicator, but I am looking for a way to retrieve all questions associated with a rubric (klone in this case).
I have a nested association where I have Rubric > Indicator > Question. In
Share
Its looks like deep_clonable cannot handle has_many :through type associations. I ended up doing this by hand like this:
So for the 3 models I am trying to clone (Rubrics, Indicators and Questions) I created 3 other models that basically mimic these models. I called them Template (for Rubric), IndicatorTemplate(for Indicators) and QuestionTemplate(for Questions). Then I create a new Rubric, and step through the indicators and questions making the proper associations along the way.