moiristo / deep_cloneable

This gem gives every ActiveRecord::Base object the possibility to do a deep clone that includes user specified associations.
MIT License
786 stars 88 forks source link

Rails2.x 3.0 #14

Closed zozi closed 11 years ago

zozi commented 12 years ago

A fix for handling has_and_belongs_to_many associations. This only clones the join table rows, not the associated objects.
However, I believe habtm is currently broken, since there were no tests that used it, and I could not get it to work at all because of errors in determining the reverse association. You might use this as a starting point, and change the cloning behavior.

zozi commented 12 years ago

whoops - broke the schema and forgot to push the unbreaking commit.

moiristo commented 12 years ago

Will take a look at it this week. Thanks :)

moiristo commented 12 years ago

I had a lot of trouble running the tests for the rails2 branch. Turns out that the module include didn't work at all for most rails versions. Therefore, I'm using alias_method_chain right now. I have merged your code into rails2.x-3.0 branch. Can you check whether everything is still working fine for you?

Note that I've also updated the master branch, as habtm was broken there as well.