# Best practis; copy model with associated models

**URL:** <https://www.ruby-forum.com/t/best-practis-copy-model-with-associated-models/122759>\
**Category:** Rails\
**Created:** [December 11, 2007, 10:18pm UTC](https://www.ruby-forum.com/t/best-practis-copy-model-with-associated-models/122759 "2007-12-11T22:18:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![harm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@harm](https://www.ruby-forum.com/u/harm)\
**Post date:** [December 11, 2007, 10:18pm UTC](https://www.ruby-forum.com/t/best-practis-copy-model-with-associated-models/122759/1 "2007-12-11T22:18:00Z")

</div>

Dear list,  
For a customer I am building a collaboration environment, including a  
wiki/forum/file sharing etc. Now they want to ‘template’ a  
collaboration environment by adding some default files, prefilling the  
wiki, inviting a default set of users.  
As you can see this involves quite some models. And I trying to figure  
out what would be the best way to implement this. Use YML files?  
Create a ‘template’ flag in my database and copying everything to a  
live instance?  
I am a bit at a loss here.  
Any help would be greatly appreciated!

With kind regards,  
Harm

---

<div class="post-metadata">

**Author:** ![harm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b4bc9f/32.png) [@harm](https://www.ruby-forum.com/u/harm)\
**Post date:** [December 11, 2007, 10:46pm UTC](https://www.ruby-forum.com/t/best-practis-copy-model-with-associated-models/122759/2 "2007-12-11T22:46:10Z")

</div>

The template flag works for us. Doing something very similar. Depending  
on  
how much data you’re moving it could take a while to create all the  
associated objects when you do a copy. Be mindful of that.
