moiristo / deep_cloneable

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

'Add support for conditionals in array inclusions' isnot in 2.1.1 #53

Closed hw676018683 closed 8 years ago

hw676018683 commented 8 years ago

The usage of the following isnot in 2.1.1, please add a new version

ship.deep_clone include: [
  pirates: [ :treasures, :mateys, if: lambda {|pirate| pirate.name == 'Jack Sparrow' } ]
]

this maybe mislead others, sush as me

moiristo commented 8 years ago

Whoops, you're right! I built that back in april in my free time, but I never got any feedback for it, that's why I didn't release it. Have you tried it using the git master and does it work as it should?

hw676018683 commented 8 years ago

it is not what i expected. I looked at the source code, i need it no more, so i donot test it. I need one that conditionally selects associations according to parent association, but i did not find the one.

moiristo commented 8 years ago

Added in 2.2.0.