Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 2.67 KB

spec.md

File metadata and controls

44 lines (32 loc) · 2.67 KB

Specifications for the Rails Assessment

Specs:

  • Using Ruby on Rails for the project

  • application generated via the command 'rails new'

  • Include at least one has_many relationship (x has_many y; e.g. User has_many Recipes)

  • Include at least one belongs_to relationship (x belongs_to y; e.g. Post belongs_to User)

  • Include at least two has_many through relationships (x has_many y through z; e.g. Recipe has_many Items through Ingredients)

  • Include at least one many-to-many relationship (x has_many y through z, y has_many x through z; e.g. Recipe has_many Items through Ingredients, Item has_many Recipes through Ingredients)

  • user has_many books through library and vice versa. libraries (join table) belong_to a book and a user

  • The "through" part of the has_many through includes at least one user submittable attribute, that is to say, some attribute other than its foreign keys that can be submitted by the app's user (attribute_name e.g. ingredients.quantity)

  • This is fulfilled through the Recommendation join model that includes a comment attribute.

  • Include reasonable validations for simple model objects (list of model objects with validations e.g. User, Recipe, Ingredient, Item)

  • I have various validations for my models (aside from the ones already provided with devise). The main ones are in my book model that contains a validations for title and author on presence, length, and uniqueness of the combination of both (since some books have the same title but different authors and authors have multiple books).

  • Include a class level ActiveRecord scope method (model object & class method name and URL to see the working feature e.g. User.most_recipes URL: /users/most_recipes)

  • The libraries model has a popular_books scope method and URL that returns the 5 most popular books in user libraries.

  • Include signup (how e.g. Devise)

  • Include login (how e.g. Devise)

  • Include logout (how e.g. Devise)

  • I use devise for signup/login/logout

  • Include third party signup/login (how e.g. Devise/OmniAuth)

  • I use Facebook through the facebook omniauth gem.

  • Include nested resource show or index (URL e.g. users/2/recipes)

  • recommendations are nested under users

  • Include nested resource "new" form (URL e.g. recipes/1/ingredients/new)

  • a new book can be created from a nested form in the libraries form

  • Include form display of validation errors (form URL e.g. /recipes/new)

  • There are validation errors listed in the books new view if the book is invalid.

Confirm:

  • The application is pretty DRY
  • Limited logic in controllers
  • Views use helper methods if appropriate
  • Views use partials if appropriate