foxnewsnetwork / American-Lit-315

1 stars 1 forks source link

Product Type fixes #41

Closed trevor-umeda closed 12 years ago

trevor-umeda commented 12 years ago

Type of product is now an actual table. It'll be small and maybe a waste of space for now but it allows for growth.

product/new now has a dropdown box so they can select types. It takes all types from the type table

product/inventory display now just goes over all types, if there is no type of that in inventory it doesn't try to show it.

Mainly these changes are to make it easily maintainable, just have to add types in one spot. Also for those trying to update the code, maybe like thomas, we won't have the same stuff in our db so alot of stuff will fail. This should make it so anyone can pull and see whats up.

To update types just update in the seed file.

This isn't an issue but just an update on what I did so you'll know. If everything is fine close this issue. Remember to run db:seed and db:migrate

SpinnakerSix commented 12 years ago

works perfectly. should i delete the product_type column then, it seems deprecated now.

trevor-umeda commented 12 years ago

Well currently the product doesn't actually remember the type object. It looks at the name, remembers that string and puts it down in the product_type column. Because how simple a type is (meaning there isn't too much behind it yet beyond the name), leave the column