mw007 mw007 Sun Mar 20 21:07:55 -0400 2011

Subject: Creating has_many relationships without lookup table and non-standard foreign key names

First, I'd like to reference this post:

My problem is a bit different, though. I have only two tables, listed here,

Basically, a Category can have many Pictures. Sort of like folders on a computer.

I'm trying to use the following AR models to create my relationship:

Obviously, my schema is a bit more complex than the single relationship I mentioned here. I'd like to get this one working first, then move on to some more complicated ones.

Any point in the right direction is appreciated.

mw007 mw007 Sun Mar 20 21:33:00 -0400 2011

Okay, I was able to come up with the following solution.