Skip to content

Ports - Sav & Kim#12

Open
Kimberly-Fasbender wants to merge 178 commits intoAda-C11:masterfrom
Kimberly-Fasbender:master
Open

Ports - Sav & Kim#12
Kimberly-Fasbender wants to merge 178 commits intoAda-C11:masterfrom
Kimberly-Fasbender:master

Conversation

@Kimberly-Fasbender
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 A passenger has many trips, a driver has many trips, and a trip belongs to a passenger and to a driver.
Describe the role of model validations in your application They are back-end validations, and they ensure that you get all of the information you need for an entity.
How did your team break up the work to be done? We tried to split it up 50/50.
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 project main requirements first, and then the secondary requirements next, and then we moved on to the kick ass styling part! Vroom vroom.
What was one thing that your team collectively gained more clarity on after completing this assignment? Routes, and models, and everything like testing.
What is your Trello board URL? https://trello.com/b/EuAE3Rt8/ada-ride-share-app
What is the Heroku URL of your deployed application? https://k-and-s-rides.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? Communication skills were off the hook, and our workflow was seamless even though we didn't have much in-person interaction this week. Yay team!

Kimberly-Fasbender and others added 30 commits April 15, 2019 15:30
@CheezItMan
Copy link
Copy Markdown

Rideshare Rails

What We're Looking For

Feature Feedback
Baseline
Appropriate git usage with no extraneous files checked in and all team members contributing Good number of commits no extraneous files committed.
Answered comprehension questions Check,
Uses named routes (like _path) Check
RESTful routes utilized No unused routes, good nested route for requesting a trip!
Project Requirements
Table relationships Check
Business logic is in the models Check, see a suggestion inline.
Controller tests Check, see some inline notes
Database is seeded from the CSV files Check
Trello board is created and utilized in project management I assume so, but you didn't make your Trello board public so I can see it.
Heroku instance is online Check
The app is styled to create an attractive user interface Crazy good look, nice use of flexbox
Overall Nice work, you hit all the learning goals in the project. I love the styling and you did a pretty good job with testing and putting business logic into the models. You also hit all the functionality. Great job!

must_redirect_to trip_path(valid_id)
end

it "must respond with a 404 if the trip was not found" do
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What about if you try to update a trip with invalid data (like a negative cost or something).

expect(flash[:success]).must_equal "Connected to Driver: #{avail_driver.name} for requested trip"
end

it "will redirct and return error message flash if no available drivers" do
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a great test, although "redirct" should be "redirect"

@driver = Driver.find(@trip.driver_id)
@driver.update(available: false)
end
it "will update trip rating" do
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You should also have a test with an invalid trip id.

expect(@trip.rating).must_equal 4
end

it "will update status of driver to available from unavailable" do
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Wait... a driver should be available after this action, not before... small grammar issue.

def create
passenger_id = params[:passenger_id]
@passenger = Passenger.find_by(id: passenger_id)
driver = Driver.next_available
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good business logic method.

However look at the length of this create method. You should abstract some of the logic out into the model.

@@ -0,0 +1,4 @@
<section class="form trip">
<h1>Edit Trip</h1>
<%= render partial: "trips_form", locals: {action: "Update"} %>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You don't need a partial here as you don't have a new trip form.

<%= f.select :passenger_id, Passenger.all.map{ |passenger| [passenger.name, passenger.id] } %>

<%= f.label :cost%>
<%= f.number_field :cost, :required => true, in: 1.65..100.00, step: 0.01 %>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice work with all the front-end validations

Comment thread app/models/driver.rb
validates :car_make, presence: true
validates :car_model, presence: true

def self.next_available
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Awesome!

Comment thread app/models/passenger.rb

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You should also consider requesting a trip as a method in the Passenger class.

Comment thread config/routes.rb
patch "/trips/:id/complete", to: "trips#complete", as: "complete_trip"

resources :passengers do
resources :trips, only: [:create]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great, no unused routes!

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