Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 2.7 KB

spec.md

File metadata and controls

29 lines (24 loc) · 2.7 KB

Specifications for the Rails Assessment

Specs:

  • Using Ruby on Rails for the project - This is pretty self-explanatory
  • Include at least one has_many relationship (x has_many y; e.g. User has_many Recipes) - A User has many notes
  • Include at least one belongs_to relationship (x belongs_to y; e.g. Post belongs_to User) - Notes belong to many Users
  • Include at least two has_many through relationships (x has_many y through z; e.g. Recipe has_many Items through Ingredients) - Users have many levels through notes, Users also have many categories through notes.
  • 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) Users have many notes and Notes have many users (through some aliased foreign keys)
  • 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) - Users can submit a priority level and a category.
  • Include reasonable validations for simple model objects (list of model objects with validations e.g. User, Recipe, Ingredient, Item) - Validations for presence and uniqueness are used throughout the app.
  • 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) - Both the notes and users controllers utilize .where
  • Include signup (how e.g. Devise) - Visible in the users/new view
  • Include login (how e.g. Devise) - Visible in the sessions/new view
  • Include logout (how e.g. Devise) - Visible in the layout file
  • Include third party signup/login (how e.g. Devise/OmniAuth) - Omniauth used
  • Include nested resource show or index (URL e.g. users/2/recipes) - see user_notes_path in the notes controller
  • Include nested resource "new" form (URL e.g. recipes/1/ingredients/new) - see edit_note_path in the notes index view
  • Include form display of validation errors (form URL e.g. /recipes/new) - see form partial in the notes - new view

Confirm:

  • The application is pretty DRY - There is always room for improvement, but I abstracted a form using a partial and avoided redundant code wherever I saw possible.
  • Limited logic in controllers - Yes
  • Views use helper methods if appropriate - I could not find any use for helpers, but I am open to refactoring.
  • Views use partials if appropriate - Yes

Blog Post - https://rlj0713.medium.com/rails-for-the-first-time-b1d333d04576 5 min walkthrough - https://www.youtube.com/watch?v=x6Nwust8Ojg