Hey,
I am starting my store application again for the 3rd time, I am just
trying to get eveything right so that I don''t come up with any more
complex problems later. Hopefully someone can steer me in the right
direction.
I have a store that sells lots of types of product.
e.g. CDs, T-Shirts, DVD
Each product type has different associations.
Cds - multiple artists, multiple genres, multiples record labels
T-Shirts - one artist
DVD - one artist, one video format (NTSC, PAL)
My problem is that while these product types and have different
characteristics are all still products, I am wondering if there is any
benefit in using Polymorphic Assocations to link these all together as
Products or if I have misunderstood the reasons for using them in the
first place. I have read a link that recommends them for this but
nothing to demonstrate this actually in practice by anyone.
I wonder if, when I have actually been able to implement this I will be
able to use them like so
artist = Artist.find(1)
artist.products.each do |p|
blah blah blah
end
To be honest many of the explanations I have read on Polymorphic
Associations have left me a little bewildered. I am sure once I get them
working the concept won''t seem so alien.
Thanks
Rob
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---