Sha256: 97a8eea6d49475398980d0e5bb5ddfce9a53ffc319092b2d305e4b4c4dc755dc

Contents?: true

Size: 1.57 KB

Versions: 1

Compression:

Stored size: 1.57 KB

Contents

= Deep_cloneable

This gem gives every ActiveRecord::Base object the possibility to do a deep clone. It is a rails3 upgrade of the deep_cloning plugin (http://github.com/openminds/deep_cloning).

== Requirements

* Activerecord, tested with Rails 3.

== Installation
 
* Install by adding the gem to your Gemfile

  gem 'deep_cloneable'
 
* Rails 2:

  gem install deep_cloneable

And include the gem in your apps config

  config.gem 'deep_cloneable'

* Or install as a plugin if you must:

  ./script/plugin install git://github.com/moiristo/deep_cloneable.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}]

== Note on Patches/Pull Requests
 
* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
  future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

== Copyright

Copyright (c) 2010 Reinier de Lange. See LICENSE for details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
deep_cloneable-1.0.0 README.rdoc