On 19 Nov 2008, at 21:13, Misiek Sz wrote:

>
> Thats a good suggestion, but I don't think it will work for me. What  
> I'm
> trying to do is give users capability to clone a specific record and
> clone all associations with it as well. The thing is that I have many
> models and a lot different associations and I don't want hard code  
> them
> all. I would like to have something dynamic that identifies all the
> assoc for a specific record and then clones those and ties them to the
> new parent record created. Sort of like a deep cloning, but without
> specifying the associations.
>
my main point was that that is where you will have to derive the  
information from. There's nothing that says that column x is an  
association (although if it's an integer ending in _id it's very  
likely). But by looking at the reflections, you can list all  
associations, and thus all the columns involved (and you'll have to do  
this if you wanted the has_manys).
Just looking at columns probably might also give you trouble with  
things like polymorphic associations.

Fred
> -- 
> Posted via http://www.ruby-forum.com/.
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to