Skip to content

Severin & Kimberley - Carets#15

Open
kimberleyamackenzie wants to merge 74 commits into
Ada-C8:masterfrom
kimberleyamackenzie:master
Open

Severin & Kimberley - Carets#15
kimberleyamackenzie wants to merge 74 commits into
Ada-C8:masterfrom
kimberleyamackenzie:master

Conversation

@kimberleyamackenzie

Copy link
Copy Markdown

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

Question Answer
Describe the types of entity relationships you set up in your project and why you set up the relationships that way Drivers can have many trips, and passengers can have many trips. Trips can have many passengers and drivers respectively. Drivers and passengers id's are foreign keys in the trips database.
Describe the role of model validations in your application Ensures it fails gracefully and that information necessary for the program to run is input.
How did your team break up the work to be done? We largely pair programmed. We worked on the database design and validations together. We worked on most of the controller methods in parallel (i.e. on partner doing passengers and one partner doing the same thing for driver). We primarily delegated the styling and project management tasks to individual partners.
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 developing all the user stories in the specs. There are some additional styling/visual elements we would incorporate given more time. We discussed, but did not have time to implement an additional database column that if the driver is online, then specifies whether that driver is available to take a rider or already has a passenger. The logic for this is not difficult per se, but the work flow is slightly awkward given the artificial constraints of the project because, for example, there's no naturally occurring point to end a ride.
What was one thing that your team collectively gained more clarity on after completing this assignment? Nested routes. The directions in the Github curriculum were confusing because we did not need to do many of those steps. We did not initially understand that Trips IS the intermediate connection in the many to many relationship between Drivers and Passengers.
What is your Trello URL? https://trello.com/b/F1WnW820/rideshare-planning
What is the Heroku URL of your deployed application? http://adryft-yacht-share.herokuapp.com/

@tildeee

tildeee commented Oct 11, 2017

Copy link
Copy Markdown

Hey all!

The following things didn't work for me on my machine:

  • Deleting a driver tries to redirect to the driver show page for that driver
  • Creating a trip with no online drivers sends me to an error page
  • Creating a trip with blank fields creates a Trip with nil values, which saves successfully but creates errors when viewing a passenger or driver associated with that trip (no validations on Trip)

Your site looks beautiful!

Comment thread app/controllers/drivers_controller.rb Outdated
driver = Driver.find_by(id: params[:id])

if driver.destroy
redirect_to driver_path

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

should redirect to drivers_path, otherwise it tries to access an individual driver's show page with the id in the params

Comment thread app/models/driver.rb Outdated
end

def self.assign_driver
(Driver.find_by(status: true)).id

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

there needs to be handling for if Driver.find_by returns nil

Comment thread app/models/trip.rb
@@ -0,0 +1,4 @@
class Trip < ApplicationRecord
belongs_to :driver
belongs_to :passenger

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There are no validations on Trip creation. Either add some validations here, or handle in your controller what happens if there's no date or cost passed into the form

Comment thread app/models/driver.rb
def total_earnings
sum = 0
trips.each do |trip|
sum += trip.cost

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Without validations on the Trip model, a trip with a nil cost can be associated with a driver. Then, this driver iterates through all of its trips. When it executes trip.cost, it returns nil, and then tries to add it to sum, which produces an error

@tildeee

tildeee commented Oct 11, 2017

Copy link
Copy Markdown

Rideshare-Rails

What We're Looking For

Feature Feedback
Baseline
Appropriate Git Usage with no extraneous files checked in and both partners contributing x
Answered comprehension questions x
Uses named routes (like _path) x
RESTful routes utilized x
Rideshare Rails Specific Content
Table relationships x
Validation rules for Models missing Trip validations
Business logic is in the models x
Database is seeded from the CSV files x
Trello board is created and utilized in project management add me to your trello board: dee@adadevelopersacademy.org
Postgres database is used x
Heroku instance is online x
The app is styled to create an attractive user interface x
Overall

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