public this repo is viewable by everyone
Description: DeepCloning plugin
Homepage: http://blog.defv.be/2008/3/27/activerecord-deepclone-plugin
Clone URL: git://github.com/DefV/deep_cloning.git
name age message
folder MIT-LICENSE Fri Mar 28 06:17:34 -0700 2008 License ;-) [DefV]
folder README.rdoc Thu Apr 17 03:03:06 -0700 2008 Cloning really deep with multiple associations [DefV]
folder Rakefile Tue Apr 08 03:18:48 -0700 2008 Renamed README to README.rdoc, added the Rakefi... [DefV]
folder about.yml Sat Mar 29 13:12:04 -0700 2008 about.yml added [DefV]
folder init.rb Thu Mar 27 11:53:30 -0700 2008 Added testing suite and plugin tests [DefV]
folder lib/ Thu Apr 17 03:03:06 -0700 2008 Cloning really deep with multiple associations [DefV]
folder test/ Thu Apr 17 03:03:06 -0700 2008 Cloning really deep with multiple associations [DefV]
README.rdoc

Deep Cloning Plugin

This plugin gives every ActiveRecord::Base object the possibility to do a deep clone.

Repository is on github: http://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 attribute

   pirate.clone :except => :name

Cloning a model without multiple attributes

   pirate.clone :except => [:name, :nick_name]

Cloning one single association

   pirate.clone :include => :mateys

Cloning multiple associations

   pirate.clone :include => [:mateys, :treasures]

Cloning really deep

   pirate.clone :include => {:treasures => :gold_pieces}

Cloning really deep with multiple associations

   pirate.clone :include => [:mateys, {:treasures => :gold_pieces}]

Copyright © 2008 Jan De Poorter, released under the MIT license