¶ ↑
Deep Cloning PluginThis plugin gives every ActiveRecord::Base object the possibility to do a deep clone.
Repository is on github: github.com/DefV/deep_cloning/tree/master
Install with:
script/plugin install git://github.com/DefV/deep_cloning.git
¶ ↑
Example¶ ↑
Cloning a model without an attributepirate.clone :except => :name
¶ ↑
Cloning a model without multiple attributespirate.clone :except => [:name, :nick_name]
¶ ↑
Cloning one single associationpirate.clone :include => :mateys
¶ ↑
Cloning multiple associationspirate.clone :include => [:mateys, :treasures]
¶ ↑
Cloning really deeppirate.clone :include => {:treasures => :gold_pieces}
¶ ↑
Cloning really deep with multiple associationspirate.clone :include => [:mateys, {:treasures => :gold_pieces}]
Copyright © 2008 Jan De Poorter, released under the MIT license