Skip to content

Conversation

MyriamWD
Copy link

@MyriamWD MyriamWD commented Apr 19, 2019

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 passenger has many trips, driver has many trips, trips belong to driver, trips belong to passenger. We have this set up because it reflects the functionality required.
Describe the role of model validations in your application When we create and edit drivers, passengers, and trips we make sure all the fields have been filled out.
How did your team break up the work to be done? We distributed the tasks for the different pieces of the project and addressed the overlapping responsibilities in person.
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 chose to work on features (create,edit,destroy,etc.) for the driver and passenger controller before the trip since we won’t be able to create a trip without an existing driver and passenger. We did not get to work on 1 feature where we could add availability status for a driver and assign an available driver to a new trip. In addition, 2 of our tests on the create function of the trips controller did not pass as we used nested routes. We have not been able to fix those two tests yet. Even though those test fail, the create function for trips controller is working. Style has not been applied yet.
What was one thing that your team collectively gained more clarity on after completing this assignment? We liked the chance to apply the branching knowledge from this week and we have clarity on how to do it but there are still mysterious things happening beyond our understanding.
What is your Trello board URL? https://trello.com/b/rBxk4Tas/rideshare
What is the Heroku URL of your deployed application? https://nm-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? We did a good job providing and receiving feedback. We listened to each other's points of view and tried to apply them to our project.

lebaongoc and others added 30 commits April 15, 2019 15:44
…d, reset db to pull data from CSV into the database
@CheezItMan
Copy link

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 unnecessary files committed that I noticed. Try to avoid commit messages like bleh
Answered comprehension questions Check
Uses named routes (like _path) Check
RESTful routes utilized Check, good use of nested routes, You do have some routes which don't appear in the demo.
Project Requirements
Table relationships Check
Business logic is in the models Check
Controller tests Check out your tests for update, you missed a few. Otherwise nice work!
Database is seeded from the CSV files Check
Trello board is created and utilized in project management Check
Heroku instance is online Check
The app is styled to create an attractive user interface Very little styling
Overall You have hit most of the learning goals. Things that aren't working as expected include creating trips, some small things in testing, styling, and some bugs in your controllers. It rather looks like you ran out of time. Take a look at my feedback and let me know questions that you have.

}

expect {
post passenger_trips_path, params: trip_create

Choose a reason for hiding this comment

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

This test is failing because this path is wrong. You need a route param for the passenger id.

post passenger_trips_path(Passenger.first.id)

It also doesn't need a params hash, because there is no form being submitted to the controller action.

resources :drivers
resources :trips, except: [:new, :create, :update]
resources :passengers do
resources :trips, only: [:new, :create, :update]

Choose a reason for hiding this comment

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

Do you need the new form action?

Does the update action need to be nested inside passengers?

It is really good that you are making sure not to produce unused routes.

end
end

def new

Choose a reason for hiding this comment

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

Do you need a new action for trips?

The demo app has you create trips automatically without the form.

<%= f.label :driver_id %>
<%= f.text_field :driver_id%>

<%= f.label :passenger_id%>

Choose a reason for hiding this comment

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

This should not be a text field, instead a select or something, something like what we have in the Ada Books with authors. Of course you should also have created trips without a form.

belongs_to :driver
belongs_to :passenger

validates :driver_id, presence: :true

Choose a reason for hiding this comment

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

You don't need the validations for the foreign keys.


describe "update" do
# Your tests go here
it "updates an existing trip" do

Choose a reason for hiding this comment

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

You don't have any test with invalid data and invalid trip id.

expect(driver_to_update.vin).must_equal update_input[:driver][:vin]
end

it "will return a bad_request when trying to update with invalid data" do

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 when the driver id is invalid.

def update
driver = Driver.find_by(id: params[:id])

is_successful = driver.update(driver_params)

Choose a reason for hiding this comment

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

If the driver isn't found, you have a problem...

def update
passenger = Passenger.find_by(id: params[:id])

is_successful = passenger.update(passenger_params)

Choose a reason for hiding this comment

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

What about if the passenger isn't found?

end

def update
trip = Trip.find_by(id: params[:id])

Choose a reason for hiding this comment

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

Similar issue to other controllers.

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