Skip to content

Conversation

@griffifam
Copy link

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 We set up our relationships as drivers has_many passengers through trips and passengers has_many drivers through trips. We both kind of forgot how to do the add_reference so we initially set up our relationships this way. Also, it worked.
Describe the role of model validations in your application If a user doesn't fill out a name or vin for a driver or a name or phone number for a passenger when entering in a new driver or new passenger, error messages are displayed. This is to ensure our database has the correct information and isn't filled with new drivers or passengers with no names, vins, or phone numbers.
How did your team break up the work to be done? First we discussed the relationships, all the tasks that needed to be done to finish the project, how to break up the tasks. Initially, Amber Lynn took the work for completing the controller, views and models for the passenger and Dionisia took the views, models and controller for Driver. Then we both worked on Trips controller, views and models and then the html and css formatting. We made a great team.
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 got all the features done that were needed, expect maybe a toggle button for a driver if they were available or not. Also, we weren't able to paginate like we wanted, but that's something we can work on later.
What was one thing that your team collectively gained more clarity on after completing this assignment? We both understood the business logic and why to implement it in the model instead of the controller. We also better learned the relationships between models.
What is your Trello board URL? https://trello.com/b/hIE7V4pn/rideshare-amber-lynn-dionisia
What is the Heroku URL of your deployed application? https://adaventures.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? We both agreed we were good at communicating what we needed to do, how to divide up the work, and asking for help when we needed it. We were also good at completing tasks that we said we would complete on our own time.

griffifam and others added 30 commits October 1, 2018 16:26
@tildeee
Copy link

tildeee commented Oct 9, 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, with errors
Trello board is created and utilized in project management x
Heroku instance is online x, I need to respond to your messages about what's up with the Heroku deployment!
The app is styled to create an attractive user interface x
Overall

Hey all! Good work on this project. I think it looks pretty great!

I think that everything looks pretty good! I have a couple of comments on how to improvement, but with only one urgent comment:

When seeding your database, you all run into issues about a lot of the Passenger and Trip data not being loaded correctly.

The trips aren't loading from the seed file because it can't find the correct passenger...

The Passengers aren't loading because you all have a validation on the passenger data. It says that a lot of the passenger data from the seed files don't fit your validation, so they don't get saved to the database.

That being said, I'll put the rest of the comments on Github, and overall this is pretty good! Good work

rating += trip.rating
counter += 1
end
return (rating.to_f/counter).round(2)
Copy link

Choose a reason for hiding this comment

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

This is pretty good -- a more programmer way of looking at this problem is:

  1. Instead of counter and incrementing it, just using self.trips.size or self.trips.count to get you the size of the array
  2. Instead of using a .each, using the Enumerables sum method https://ruby-doc.org/core-2.5.1/Enumerable.html#method-i-sum

This method could be as slim as:

def average_rating
  return ( self.trips.sum / self.trips.size ).round(2)
end

end
end
return trips
end
Copy link

Choose a reason for hiding this comment

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

This method returns an array of all trips associated with this Driver.

Why couldn't we just use the built in .trips method? The built in .trips method returns an array of all trips associated with this instance of Driver.

self.trips.each do |trip|
total += (trip.cost/100.to_f)
end
return total
Copy link

Choose a reason for hiding this comment

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

You might want to look into the Enumerables sum method.

You could add them all up and then divide by 100 after.

end
end
return trips
end
Copy link

Choose a reason for hiding this comment

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

Same as above: Why do we need to build a new list_trips method when Passenger has_many Trips?

@@ -0,0 +1,17 @@
<div class="driver-edit-container">
Copy link

Choose a reason for hiding this comment

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

Why is this class driver-edit-container in the new view?

@@ -0,0 +1,19 @@
<div class="container">
<div class="div3">
Copy link

Choose a reason for hiding this comment

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

In general, class names like div3 aren't so great-- I have no idea what they represent or what they'll hold! When I add styles to this in the CSS file, how do I know what this is supposed to look like by the name?

@@ -0,0 +1,19 @@
<div class="container">
<div class="div3">
<h3 id="pass_list" class="passenger_list">List of Passengers</h3>
Copy link

Choose a reason for hiding this comment

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

Just a small comment-- it happens to be CSS/HTML naming convention that class names are hyphen separated. I know! So many different naming conventions.

<div class="div3">
<h3 id="pass_list" class="passenger_list">List of Passengers</h3>
<ol class="passenger_list">
<% i = 0 %>
Copy link

Choose a reason for hiding this comment

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

Why was i = 0 declared?

root 'trips#index'

resources :trips do
resources :passengers, include: [:index, :show]
Copy link

Choose a reason for hiding this comment

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

Why do we nest passenger routes in trips?

Nesting passenger routes in trips gives us the routes like
trip_passengers GET /trips/:trip_id/passengers ... What does that get us?

Also, is the syntax isn't include:, it's only:


# Drivers routes
resources :drivers do
resources :trips, include: [:new, :index, :show]
Copy link

Choose a reason for hiding this comment

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

Same as above: Why do we need to nest trips routes into drivers?

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