[Nitro] [PATCH] Entity copying methods

Rob Pitt rob at motionpath.com
Fri Jan 27 11:45:14 EST 2006


On Fri, 2006-01-27 at 16:58 +0100, vseguip at gmail.com wrote:
> Hi Robb,
>   I was one of the requesters so thanks for your work! Some comments follow.
> 
> 
> > Adds a .og_clone method to every entity which passes any arguments you
> > supply onto the .new constructor when making the cloned object.
> >
> > The cloned object contains copies of all properties and all relations
> > except HasMany which is impossible to copy as it involves modifying
> > other objects BelongsTo relation, breaking the original relationship.
> >
> Wouldn't it be possible to recursively copy/clone the weak entity
> (optionally)? That would make this patch perfect for my needs.

I see you changed your mind after reading my code comments but it would
be a small change to make this happen and I will do it on Monday.

> 
> > BelongsTo/RefersTo etc (the inferior half of the relationship) will all
> > copy ok, as will joins.
> 
> Do joins made through another Class also copy the join data? For example
> 
> class A
>  joins_many B, :through =>C
> end
> 
> class B
>  joins_many A, :through =>C
> end
> 
> class C
> end
> 
> Will this also copy the join data contained in C?

No I was not aware this even existed, I will look at changing it when I
make the other modification.

> 
> A lot of thanks for your work Rob!
> 
> Cheers,
>  V. Segui
> 
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general




More information about the Nitro-general mailing list