Ampers Victoria/Mary#9
Open
mmlamkin wants to merge 47 commits into
Open
Conversation
…till need to be added, however.
…passenger New and Edit done. Methods for Passenger and Driver controller edit and update methods done. Database reset.
…model. No testing done, though: Not at all sure if any of this works.
…e to make it visible. No styling of it, yet, though.
Made features for driver on a separate branch. Now merging these in.
…g with it, however.
…d the relevant routes, plus fixed the resulting math-on-nil and division-by-zero issues in the driver and passenger business logic.
…engers and trips controllers, the trips models, and the routes.
…ed passengers to work. Now putting it in Driver.
…ips for trips with deleted drivers to work on the passenger's show page.
Rideshare-RailsWhat We're Looking For
|
CheezItMan
reviewed
Apr 8, 2018
| <% @drivers.each do |driver| %> | ||
|
|
||
| <li> | ||
| <img src="http://placecage.com/g/100/100" alt="photo"/> |
There was a problem hiding this comment.
Just a small note, it's human nature to want to click on a user's picture, so making the picture a link as well, would be good.
| belongs_to :passenger | ||
|
|
||
| validates :driver_id, presence: true | ||
| validates :passenger_id, presence: true |
There was a problem hiding this comment.
You should also validate the cost being >= 0 and the rating being 1 - 5.
| def create | ||
| @trip = Trip.new | ||
| @trip.passenger_id = params[:passenger_id] | ||
| @trip.driver_id = Driver.all.sample.id |
There was a problem hiding this comment.
Are you assuming all drivers are always available?
I also notice all new trips are free (i.e. the cost is $0.0). How generous of you both!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add due date
Rideshare-Rails
Congratulations! You're submitting your assignment! These comprehension questions should be answered by both partners together, not by a single teammate.
Comprehension Questions