Threesuns

Email the Instructor

Contact

All Semesters

Semesters

All Courses

Courses

2013Spring

01.14.13 - 05.12.13

Rails I

CSYS2863

Tuesday Thursday
11:00 AM - 12:20 PM

AdvancedActiveRecord

Lab03

Objective: To practice using ActiveRecord with Associations

pastdue

Submit Your Solution

Lab03

Request a Copy of your Solution

Lab03

Requirements

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

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