Making a copy of a model and all its associated records.

Hi all,

I have a question regarding the duplication of a model and it's
associations. For example, if I have ModelA and it has_many SubModelAs
and has_many SubModelBs associated with it. Each of the SubModels a
belongs to ModelA. Is there a quick way of copying ModelA and the
structure that lays below it? In the end I'll then end up with ModelB
which is a copy of A, and it has copies of SubModelA and SubModelB
records.

Cheers,
Diego