Cloning a record in rails, is it possible to clone associations and deep copy?
I'm .clone -ing a record in rails... new_blerg = Blerg.find(1).clone This record has loads and loads of associations, and those associations even have associations. Is there a way to deep-copy a record and clone it so it is cloned with all of those associations too? Vaughn Draughon You may get some good use out of the Amoeba gem for ActiveRecord 3.2. It supports easy and automatic recursive duplication of has_one , has_many and has_and_belongs_to_many associations, field preprocessing and a highly flexible and powerful configuration DSL that can be applied both to the model and on the fly. be