Has_one_question :through => :josh_susser

Hi I’m making a book website, and I want to verify that I’m getting this

First 1. are the users (modeled exactly from the login engine plugin)
(no _id column)
then 2. the inventories,
(no _id column)
3. then the ads,
(with a inventory_id column, mypage_id, user_id, what you would call a
‘first class model’)

and now I tie it all into

  4. a MyPage where all their ads are listed.

Ok… quick breather…

I would then declare my models the following way:

  1. users
    has_many :inventories, :through => :ads
    has_one :mypage

  2. inventories
    has_many :users, :through => :ads


no relationships declaration needed

  1. mypage
    has_many :inventories, :through => ads
    belongs_to :user

How does this look? Am I missing anything?

Thanks for anyone that replies.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs