On 18 Feb 2009, at 15:56, elioncho wrote:
>
> Hello guys,
>
> I am trying to create a belongs_to relation between 2 tables.
>
> table users
> id
> login
> .
>
> table apps
> id
> admin
> .
> .
>
> I need to create a belongs_to relation on the App model. The admin
> column in apps references the user login. I will have used user_id
> instead of the login name but I can''t change this right now (so
they
> said), so I have to try to make the relationship as it is. I did the
> following but I don''t know how to put that admin should reference
the
> User login column:
>
> belongs_to :owner, :class_name = "User", :foreign_key =>
"admin"
>
ActiveRecord doesn''t support that.
Fred
> Help please any,
>
> Elías
> >
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
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
-~----------~----~----~----~------~----~------~--~---