Sophie & Kim - Ride Share Rails#15
Conversation
Merge branch 'master' of https://github.com/kimvitug05/ride-share-rails
Merge branch 'master' of https://github.com/kimvitug05/ride-share-rails
There was a problem hiding this comment.
Good job! While this was yellow overall your solution was solid. The only thing that has me at all worried here is that you didn't do much model testing so I'm not totally confident you've mastered them. Keep them in mind as something to practice going forward.
Remember you can always check the feedback.md file to see what we're going to grade on!
Aside from that though your application code was clear and clean and your styling was attractive and functional.
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 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 | Trips are linked, not embedded. |
| 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 | ✔️ |
| 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 | ✅ |
| // They will automatically be included in application.css. | ||
| // You can use Sass (SCSS) here: https://sass-lang.com/ | ||
|
|
||
| $table_width: 1000px; |
| redirect_to driver_path(@driver) | ||
| return | ||
| else | ||
| render :new, status: :bad_request |
| def find_by_id | ||
| driver_id = params[:id].to_i | ||
| driver = Driver.find_by(id: driver_id) | ||
| end |
There was a problem hiding this comment.
This might have made more sense as a method on Driver.
DRYing this sort of thing up is what controller filters are for though so good instincts!
app/models/driver.rb
Outdated
| end | ||
|
|
||
| def num_of_rides | ||
| return self.trips.sum { |trip| trip } |
There was a problem hiding this comment.
You can use size here instead of sum:
| return self.trips.sum { |trip| trip } | |
| return self.trips.size |
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