Threesuns

Email

Contact

All Semesters

Semesters

All Courses

Courses

Rails I

CSYS2863

3 credits

Labs

AdvancedActiveRecord

Lab

100 points

Requirements

Book model created and meets all requirments35
Publisher model exists and meets all requirements20
Author object exists and meets all requirements20
Category model exists and meets all requirements25
Total100 pts

Objective

To practice using ActiveRecord with Associations

Instructions

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.

Extras