[Rails] Re: Find all association methods
On Jan 17, 7:08 pm, Peter Vandenabeele <pe...@vandenabeele.com> wrote:
> On Tue, Jan 17, 2012 at 7:41 AM, Kingston.s <jenor...@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 Vandenabeelehttp://twitter.com/peter_vhttp://rails.vandenabeele.com
Hi Peter,
Thanks for quick reply..
This is working fine.but it is return all the association and the
corresponding model name....
like [:has_many, :site_users]
but i want association methods like site_user_ids and site_user_ids=
kingston.s
--
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