01.11.10 - 05.09.10
Book model created and meets all requirments | 35 pts |
Publisher model exists and meets all requirements | 20 pts |
Author object exists and meets all requirements | 20 pts |
Category model exists and meets all requirements | 25 pts |
Total | 100 pts |
For this lab you will be creating a series of related models having to do with books. The actual models you will create will be Book (2 types), Author, Publisher, and Category.
The Book model should allow for each book to have a title and an isbn number, each of which is required for every book. It should also be possible to create Ebooks (Electronic books) which have a download_size which is required and Pbooks (Physical books) which have a weight which is required. All data about both sub-types of books should be stored in the books table. Books should also be able to have many authors, one publisher, and belong to one category. There should also be a named scope for books which lists all books that do not belong to a category called "uncategorized".
Authors should have a first_name and a last_name that are required. Authors should also be able to be the author of many books.
Publishers should have a name that is required and can have many books.
Categories should have a name that is required and should also be able to have a parent_category and many sub_categories. The parent and sub categories are also category objects.