Duplicating models with complex nested associations
11-Jan-2020 2806
I was recently working on an app that required duplicating an Active Record model and its associations. But the complex structure of these.This is the model I needed to duplicate (a simplified version of it). I started off by installing the popular deep_cloneable gem and assumed it would be up to the task. However, I quickly ran into an issue. The circular and nested associations were not cloned properly. This was my first attempt at duplicating the associations:.
Duplicating models with complex nested associations #ruby #rubydeveloper #rubyonrails #Duplicating #models #complex #nested #associations https://rubyonrails.ba/link/duplicating-models-with-complex-nested-associations