Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Earth & Fire - Emily & Aimee #18

Open
wants to merge 86 commits into
base: master
Choose a base branch
from
Open

Conversation

marks214
Copy link

@marks214 marks214 commented Nov 7, 2020

Assignment Submission: Rideshare Rails

Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions. These questions should be answered by all team members together, not by a single teammate.

Reflection

Prompt Response
Describe the types of entity relationships you set up in your project and why you set up the relationships that way Both a passenger and a driver will have many trips. Each trip will have one driver and one passenger. We set it up so that the trip model belongs to a passenger and a driver.
Describe the role of model validations in your application The model validations ensure that the user must enter the correct information on the forms. For example, the driver's VIN must have a length of 17 and cannot be blank.
How did your team break up the work to be done? We designed a kanban board and discussed all the project tasks. Then we communicated daily about which tasks each one of us was working on. We also created git branches while doing solo work on the controllers/models/css, then merged those back in.
What features did you choose to prioritize in your project, and what features, if any, did you have to set aside to meet the deadline? We prioritized functionality over style. Top priority was to ensure all routes work. Then driver and passenger functionality - being able to add/delete passengers and drivers, and being able to create trips them. Lowest priority was styling the project, we definitely wanted to spend time investing the backend of the project and writing tests.
What was one thing that your team collectively gained more clarity on after completing this assignment? Overall, the MVC design pattern and understanding what to check when something goes wrong.
What are two discussion points that you and your team discussed when giving/receiving feedback from each other that you would be willing to share? We were both determined to try to understand Rails and feel pretty accomplished turning in our project. There were many ah-ha moments while we both explored the MVC framework. Communication was also great and active on slack. It was great learning experience!
Optional: What is the URL of your deployed Heroku app?

marks214 and others added 30 commits November 2, 2020 18:05
marks214 and others added 27 commits November 5, 2020 14:55
@marks214 marks214 changed the title Water & Fire - Emily & Aimee Earth & Fire - Emily & Aimee Nov 7, 2020
Copy link

@kaidamasaki kaidamasaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! You missed a few functional things that were mostly attention to detail.

Make sure to check the feedback.md in the future to avoid missing those little things.

Overall though your code was clean and clear and read quite nicely!

Rideshare Rails

Major Learning Goals/Code Review

Criteria yes/no, and optionally any details/lines of code to reference
Practices collaborating with git, and all team members contribute git commits and best git practices ✔️
Demonstrates understanding of relationships by giving accurate answers to the reflection questions and appropriate code in the models ✔️
Logic to calculate a driver's average rating and total earnings is located in the model, and it has unit tests ✔️
There are reasonable tests to test the validation requirements for all models ✔️
There are reasonable tests to test the relationship requirements for all models ✔️
There are reasonable tests to test the controller actions for all controllers The the test for "trips#update" failed. ☹️
The app has an attractive and usable user interface ✔️
The app uses/is compatible with database seeds ✔️
Router code is clean: uses resources and RESTful routes ✔️

Functional Requirements

Functional Requirement yes/no
On the passenger's details page, I want to be able to see total charged, list of trips, a link to edit, and delete You linked to the trips instead of listing them.
When adding a new passenger, I want to see errors and validations that show that a passenger must be provided a name and a phone number, so that I cannot make a passenger without name or phone number ✔️
On the passenger's details page, I can create a new trip for this passenger, with an assigned driver and no rating Rating is mandatory.
On the driver's details page, I want to be able to see total earnings, average rating, list of trips, a link to edit, and delete ✔️
When adding a new driver, I want to see errors and validations that show that a driver must be provided a name and VIN, so that I cannot make a driver without name or VIN ✔️
On the trip's detail page, I want to be able to view details, assign a rating, navigate to the trip's passenger, driver, a link to edit, and delete ✔️

Overall Feedback

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 8+ in Code Review && 5+ in Functional Requirements
Yellow (Approaches Standards) 5+ in Code Review && 4+ in Functional Requirements, or the instructor judges that this project needs special attention ✔️
Red (Not at Standard) 0-4 in Code Review or 0-3 in Functional Reqs, or assignment is breaking/doesn’t run with less than 5 minutes of debugging, or the instructor judges that this project needs special attention

Code Style Bonus Awards

Was the code particularly impressive in code style for any of these reasons (or more...?)

Quality Yes?
Perfect Indentation
Elegant/Clever
Descriptive/Readable
Concise
Logical/Organized

Comment on lines +1 to +2
class Homepage < ApplicationRecord
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Homepage didn't need a model.

Comment on lines +18 to +22
['⭐️', 1],
['⭐⭐', 2],
['⭐⭐⭐', 3],
['⭐⭐⭐⭐', 4],
['⭐⭐⭐⭐⭐', 5],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⭐!

Comment on lines +9 to +16
get '/trips', to: 'trips#index', as: 'trips'
get '/trips/new', to: 'trips#new', as: 'new_trip'
post '/trips', to: 'trips#create'

get '/trips/:id', to: 'trips#show', as: 'trip'
get '/trips/:id/edit', to: 'trips#edit', as: 'edit_trip'
patch '/trips/:id', to: 'trips#update'
delete '/trips/:id', to: 'trips#destroy'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could have also been resources:

Suggested change
get '/trips', to: 'trips#index', as: 'trips'
get '/trips/new', to: 'trips#new', as: 'new_trip'
post '/trips', to: 'trips#create'
get '/trips/:id', to: 'trips#show', as: 'trip'
get '/trips/:id/edit', to: 'trips#edit', as: 'edit_trip'
patch '/trips/:id', to: 'trips#update'
delete '/trips/:id', to: 'trips#destroy'
resources :trips

Comment on lines +1 to +8
class CreateHomepages < ActiveRecord::Migration[6.0]
def change
create_table :homepages do |t|

t.timestamps
end
end
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You didn't actually add any columns to this table. In the future you should avoid making tables like this.

@driver = Driver.new(driver_params)
# default: a new driver is available
@driver[:available] = true
result = @driver.save

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should try to be more specific with variable names than result.

I would probably just put the @driver.save inline but if you want to store it in a variable I would name it something like save_result.

validates :vin, length: { is: 17, message: "can't be blank"}, presence: true

def gross_earnings
gross_total = trips.sum(&:cost) / 100

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oooh, the fancy &: notation! 😃

@@ -1,175 +1,259 @@
require "test_helper"

describe DriversController do
# Note: If any of these tests have names that conflict with either the requirements or your team's decisions, feel empowered to change the test names. For example, if a given test name says "responds with 404" but your team's decision is to respond with redirect, please change the test name.
before(:all) do
@test_driver = Driver.create(name:"C14", vin: "12345678901234567", available: true)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend using create! here because it will make it obvious if your before fails to create any data:

Suggested change
@test_driver = Driver.create(name:"C14", vin: "12345678901234567", available: true)
@test_driver = Driver.create!(name:"C14", vin: "12345678901234567", available: true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants