Madison Kelly wrote:
> I'm using an array to store a list of catagories that a product will 
> belong
> to. Since the number of catagories a product can belong to isn't set 
> (could
> be 1 or could be 10), I was going to use an array. Does that sound like 
> an
> appropriate use?

Absolutely not.  For this, you should be using has_many and belongs_to 
properly.  You might find it helpful to read up on relational database 
normalization (Wikipedia has some great articles).

This is what I meant about arrays being smelly in the DB.  Usually (as 
here) you want associated records in another table.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
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