Here's my situation:

Let's say, I have a "members" table that tools like this:

id | member_id | name |

and I have a "invitation" table that looks like this:

id | member_id | date |

In my case, invitation.member_id needs to be the key to reference
members.member_id

What do I need to do in my models so I can do things like:

member.invitation.date

I've tried doing:

class Member
  has_one :invitation, :foreign_key => "member_id"
end

class Invitation
  belongs_to :member, :foreign_key => "member_id"
end

Any ideas?

Thanks.
-- 
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