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

&&: Maddie & Kate #28

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

&&: Maddie & Kate #28

wants to merge 57 commits into from

Conversation

Oh-KPond
Copy link

@Oh-KPond Oh-KPond commented Apr 7, 2018

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 and passengers are related to trips, and to each other through trips. We set is up that way because drivers and passengers don’t need to know about each other until they take a trip. Driver has_many trips and Passenger has_many trips and Trip belongs to Passenger and Trip belongs_to Driver.
Describe the role of model validations in your application Validations are used to insure that unwanted data is not put into the forms. For Passenger we need a name of any length and phone number a string of any length as well. For Driver we needed a name of any length and a VIN as a string with an exact length of 17 characters. For Trip the rating needed to be between 1 - 5 and also allow a nil value.
How did your team break up the work to be done? We worked primarily together side by side to establish the basics for models, controllers, routes, and views. Once a foundation was established Kate took the Driver to work on and Maddie took Passenger and we worked on Trip together. Towards the end we felt safe enough to divide and split the work of remaining logic for Maddie and the CSS and styling for Kate as they are mostly independent of each other at that point and would not be conflicting each other in merges
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 views for each Class, but only in that, we could see them. Styling was left until last. The model logic was done in between.
What was one thing that your team collectively gained more clarity on after completing this assignment? The relationships between the controller, model, view, and figuring out when logic goes in one or the other as well as our pairing styles when it comes to pair programming.
What is your Trello URL? https://trello.com/b/rATE6Lts/rideshare
What is the Heroku URL of your deployed application? https://amper-maddie-kate-rideshare.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 talked about the working style we felt comfortable with; independent vs. pair. We also felt that we had very open communication.

Oh-KPond and others added 30 commits April 2, 2018 17:12
madaleines and others added 27 commits April 4, 2018 15:30
@CheezItMan
Copy link

Rideshare-Rails

What We're Looking For

Feature Feedback
Baseline
Appropriate Git Usage with no extraneous files checked in and both partners contributing
Answered comprehension questions Check, but I Cannot see your Trello board. It's not shared with me!
Uses named routes (like _path) Check
RESTful routes utilized Check, nice work!
Rideshare Rails Specific Content
Table relationships Check
Validation rules for Models Check, I left some comments in for some fields that should be validated.
Business logic is in the models Check, nice work here!
Database is seeded from the CSV files Check
Trello board is created and utilized in project management I dunno I can't see it
Postgres database is used Check
Heroku instance is online Check
The app is styled to create an attractive user interface Decent styling, The styling doesn't respond quite right, but that's not in the requirements. It looks ok. I left some notes on your CSS where you could make it more responsive.
Overall Nice work, you hit all the requirements for the project, with some issues which I've referenced.

has_many :trips

validates :name, presence: true
validates :vin, presence: true, length: { in: 17..17 }

Choose a reason for hiding this comment

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

Nice!

return average
end

def self.get_available_drivers

Choose a reason for hiding this comment

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

Very good choice here making this a class method and putting it in the Driver class. 🥇

@@ -0,0 +1,13 @@
Rails.application.routes.draw do
root to: 'trips#index'

Choose a reason for hiding this comment

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

This doesn't make a great homepage. I would suggest next time creating a separate controller for the homepage.

<%= f.label :date %>

<% if !params[:passenger_id] %>
<%= f.date_field :date %>

Choose a reason for hiding this comment

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

This field isn't recording the date for the trip and not using the existing date.

You can fix this by having this in the controller

    @trip = Trip.find_by(id: params[:id])
    @date = @trip.date.split('-')
    @date = Date.new(@date[0].to_i, @date[1].to_i, @date[2].to_i)

And this as the date_field tag

<%= f.date_field :date, value: @date %>

class Trip < ApplicationRecord
belongs_to :passenger
belongs_to :driver
validates_inclusion_of :rating, in: (1..5), allow_nil: true

Choose a reason for hiding this comment

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

I would also validate that the date is required and the price must be greater than 0.

</div>
<div class="trip-driver">
<h4>Driver</h4>
<p><%= link_to trip.driver_id,trip_path(trip.driver_id), class: 'trip-link' %></p>

Choose a reason for hiding this comment

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

I would make the link have the driver's name with: trip.driver.name instead of the driver's ID, as that doesn't tell the user as much information.

<%= link_to "Trips", trips_path %>
</li>
<li>
<%= link_to "Add a trip", new_trip_path %>

Choose a reason for hiding this comment

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

Does this really go here? Shouldn't you only need to create a trip on the passenger's show page?

<h3>Trips: </h3>

<% @trips.each do |trip| %>
<section class="trips-table">

Choose a reason for hiding this comment

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

The styling on this page is a little weird when the size of the screen gets smaller. The highlighted portion shrinks, but the text is still there if you scroll to the right.

border-radius: 5px;
}

@media all and (max-width: 500px) {

Choose a reason for hiding this comment

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

A media query, neat!

.driver-card, .passenger-card {
display: grid;
grid-gap: 10px;
grid-template-columns: repeat(6, 220px);

Choose a reason for hiding this comment

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

This makes the grid of passengers and drivers rather fixed in size, maybe doing it with an auto number of columns would be more responsive.

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