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

Carly and Goeun - Edges - Rail Rideshare #13

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

Conversation

CarlyReiter
Copy link

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 We had a driver, passenger, and trip models. One driver was related to many trips, one passenger was related to many trips, but Trips is not a joined table! It’s a indirect model relation between driver and passenger. Trip has detailed columns including date, rating, and cost.
Describe the role of model validations in your application Model validations ensures that the data that we submit is appropriate. We had to adjust our model validations as we progressed, such as allowing ‘nil’ when passengers request a new trip without rating and cost.
How did your team break up the work to be done? We started off looking at the project and basic component together, split up some of the CRUD and compared. We paired on the routing and nesting, as well as the difficult business logic and controller methods towards the end. The arrangement worked out really well.
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 the requirements and getting it completely functional, and set aside much of the CSS (even though we really wanted to play with it).
What was one thing that your team collectively gained more clarity on after completing this assignment? RAILS! Status methods in the controller, nested routes - for sure, comfortable with database and migrations.
What is your Trello board URL? https://trello.com/invite/b/jzPpZnOs/4d4b61baae6c09a6f31a51d3346c3343/goeun-carly-rideshare
What is the Heroku URL of your deployed application? http://wild-ride-share.herokuapp.com
What are two discussion points that you and your pair discussed when giving/receiving feedback from each other that you would be willing to share? At the start, we discussed what went well and what didn’t in past partnerships, we discussed communication styles, did a good job of checking in with each other at start and end, and throughout each day.

CarlyReiter and others added 30 commits October 1, 2018 15:34
@tildeee
Copy link

tildeee commented Oct 11, 2018

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
Project Requirements
Table relationships x
Validation rules for Models x
Business logic is in the models x
Database is seeded from the CSV files x
Trello board is created and utilized in project management x
Heroku instance is online x
The app is styled to create an attractive user interface x
Overall

Great work Carly and Goeun! The project looks great-- I'm a huge fan of the code and how it looks. It also hits the requirements, particularly the ones we had on models.

In particular, the code you two wrote for the routes and controllers are fantastic!

good job on routes! This was a challenge for many pairs but I'm happy with where you all landed up!

Here's one more bug that I want to call out:
http://wild-ride-share.herokuapp.com/drivers/101
What happens if there are no trips associated with a driver? Then the rating would be 0.0 and trip count is 0. Ruby evaluates 0.0 / 0 as NaN or "Not A Number." When it gets to the driver/show.html.erb view, NaN.to_s evaluates to just "NaN" so it shows up on the driver page as "NaN" on the page. It'll show up like this:

"Minnie Dach
Rating is NaN"

I have a few other comments on the code, but otherwise, great work overall.

PS: i dont know who mistr toad is BUT I LOVE MR TOADS WILD RIDESHARE AND HIS FACE ON THE PAGE!!!!!!!!!!!!!!! IT MAKES ME SO HAPY!!!!!!!!!!!!!


def create
passenger = Passenger.find_by(id: params[:passenger_id])
driver = Driver.find_by(status: true)
Copy link

Choose a reason for hiding this comment

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

I think this is a really great way to assign drivers!

num_trips = self.trips.length
money = 0

num_trips.times do |i|
Copy link

Choose a reason for hiding this comment

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

Instead of using a times loop, it may be better to think of this problem as iterating through the collection of self.trips, so I would prefer maybe to use an each loop instead.

end
end

rating = rating.to_f/(num_trips-ongoing_trips)
Copy link

Choose a reason for hiding this comment

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

you end up needing the ongoing_trips variable to keep track of the length of this collection... Maybe there's a different way to filter or select ( https://ruby-doc.org/core-2.5.1/Enumerable.html#method-i-select ), and use that collection...

ongoing_trips = 0
rating = 0

num_trips.times do |i|
Copy link

Choose a reason for hiding this comment

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

Why not use an each loop here?

validates :name, presence: true
validates :phone_num, presence:true

def spent
Copy link

Choose a reason for hiding this comment

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

This is subtle, but I like the name of this method :c)

<li><strong>Trip: <%=trip.id %></strong></li>
<li>Date: <%=trip.date %></li>
<% if trip.cost == nil %>
<li>Cost: Ride in progress</li>
Copy link

Choose a reason for hiding this comment

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

Good choice! There wasn't a requirement about what to do with the trip's cost, so we asked you all to make a decision on it... I like this decision!

</div>

<% if trip.driver_id %>
<%=link_to "Driver", driver_trips_path(trip.driver_id) %>
Copy link

Choose a reason for hiding this comment

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

This link just says "Driver". Why not use the driver's name?

</div>

<% if trip.driver_id %>
<%=link_to "Driver", driver_trips_path(trip.driver_id) %>
Copy link

Choose a reason for hiding this comment

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

Should this actually go to this path? When I click here, I actually can't tell who the driver is still.

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