0.0
No commit activity in last 3 years
No release in over 3 years
Allows you to dup an ActiveRecord object with selectively keeping attributes / associations with :include, :exclude, ...
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

Deep Cloning Plugin¶ ↑

This 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 attribute¶ ↑

pirate.dup :except => :name

Cloning a model without multiple attributes¶ ↑

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

Cloning one single association¶ ↑

pirate.dup :include => :mateys

Cloning multiple associations¶ ↑

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

Cloning really deep¶ ↑

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

Cloning really deep with multiple associations¶ ↑

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

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