8000 Lauren & Gale -- Carets by enigmagnetic · Pull Request #9 · Ada-C8/rideshare-rails · GitHub
[go: up one dir, main page]

Skip to content

Lauren & Gale -- Carets - #9

Open
enigmagnetic wants to merge 78 commits into
Ada-C8:masterfrom
enigmagnetic:master
Open

enigmagnetic wants to merge 78 commits into
Ada-C8:masterfrom
enigmagnetic:master

Conversation

@enigmagnetic
@enigmagnetic enigmagnetic commented Oct 2, 2017 •
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 driver has_many trips, a passenger has_many trips, and a trip belongs_to a passenger and also belongs_to a driver. We set it up this way because passengers and drivers can both have multiple trips, but each trip can only have one driver and one passenger.
Describe the role of model validations in your application Our validations are checking the presence of required fields at the time that a model instance is created or updated. In our application, the driver requires the presence of a name and a VIN, and the VIN must be unique. The passenger requires the presence of a name and a phone number. The trip has the most validations, requiring the presence of a numeric cost, a passenger id, a driver id, and a date.
How did your team break up the work to be done? We did the initial planning together, making all of the user stories into Trello cards/TODO items, as well as mapped out entity relationships, and decided on a strategy for tackling the waves. We also decided on a timeline for completion, and divided up tasks each day by that day's wave goal. The HTML structuring and much of the debugging was also done together. We tried to do tasks that required touching many parts of the code together, and then split up more discrete tasks to work on separately.
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 functionality over UI design initially. We started with routes and CRUD functions for each of the controllers and models, and made sure the views were set up. Then we added in business logic, then started structuring the HTML for future styling (and making a landing page), then we did some review and debugging, making adjustments to the interface that were "nice to have". Lastly we styled the views. We were able to complete all of the features in the assignment, but did not add any features, not knowing what the next set of requirements might be.
What was one thing that your team collectively gained more clarity on after completing this assignment? We learned that pairing sped up processes, especially debugging, and that we were able to effectively pair remotely using Screen Hero. Learning about nested routing helped us understand how routing works, and how we can access collections of objects through the classes that own them. We also gained clarity on partials, in particular how to pass and build the correct path for a view depending on which model is being used (i.e. we made a partial to show a list of either drivers or passengers, and made sure the path would go to the appropriate show page).
What is your Trello URL? https://trello.com/b/B3d7EGwq/rideshare
What is the Heroku URL of your deployed application? https://dieshare.herokuapp.com/

enigmagnetic and others added 30 commits October 2, 2017 15:52
…of all passengers in views/passengers/index.html.erb
galestorm and others added 25 commits October 5, 2017 19:54
…mages in list partial. Add header and footer to application.html.erb
@enigmagnetic enigmagnetic changed the title Initialize rails project and reset database [Lauren & Gale -- Carets] Lauren & Gale -- Carets Oct 7, 2017
@CheezItMan
CheezItMan commented Oct 7, 2017 •
Copy link
Copy Markdown

Rideshare-Rails

What We're Looking For

Feature Feedback
Baseline
Appropriate Git Usage with no extraneous files checked in and both partners contributing Check, good commit messages and both teammate contributed.
Answered comprehension questions Check, I'm glad Screenhero worked for you, and that pairing helped things move faster.
Uses named routes (like _path) Check, Use of resources and driver_available resource.
RESTful routes utilized Check, good use of nested resources.
Rideshare Rails Specific Content
Table relationships Check
Validation rules for Models Check, validation for presence, but the rating of a trip should be limited and the value of the cost of a trip should be positive. So... some more validations are needed.
Business logic is in the models Great work getting the business logic here.
Database is seeded from the CSV files Check
Trello board is created and utilized in project management Your Trello link seems private, 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 The images just cracked me up. The site works, although the trip list is a bit compressed. Overall well done. Good use of semantic HTML tags.
Overall Ok before I get started your homepage cracked me up. I burst into giggles. Warn me next time. My wife thinks I'm a crazy(er) person. You do have some functionality not working. When I create a trip or try to create a trip I get an error message, and I've left notes in the code. So you have some work left to do, and better testing is required. Good thing we're doing testing next week!

@CheezItMan CheezItMan left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Some notes in the code.

Comment thread app/models/passenger.rb
validates :phone_num, presence: true

def total_trip_cost
costs = trips.collect { |trip| trip.cost }.inject { |sum, trip_cost| sum + trip_cost }
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 use of enumerables and good work putting the business logic into the models!

if params[:passenger_id]
@trip.passenger_id = params[:passenger_id]
end
@trip.driver_id = Driver.where(available: true).sample.id
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 there are no available drivers?

Comment thread app/controllers/trips_controller.rb Outdated
@trip = Trip.new(trip_params)

if @trip.save
redirect_to passenger_path(@passenger)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How would you have an @passenger attribute? You need to do something like

redirect_to passenger_path(@trip.passenger.id)

Comment thread app/models/driver.rb
validates :name, presence: true
validates :vin, presence: true, uniqueness: true

def total_earnings
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 work using both enumerables and putting logic into the models.

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

0