Tuesday, January 17, 2012

Re: [Rails] Find all association methods



On Tue, Jan 17, 2012 at 7:41 AM, Kingston.s <jenorish@gmail.com> wrote:
Hi all,


I want to get all association methods in one single model....

Any default method is provided by Active Record ???

i am using ruby 1.9.3 and rails 3.1.3


User.reflect_on_all_associations.map{|a| [a.macro,a.name]}

etc.

Peter

--
Peter Vandenabeele
http://twitter.com/peter_v

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate