-
Notifications
You must be signed in to change notification settings - Fork 28
Leaves && Branches! Emily V and Caroline #30
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
base: master
Are you sure you want to change the base?
Conversation
set up models, controllers, and schema
added validations
actually adding tests
customers index
movies#create done
edited seed file
…and movies#current
Rentals tests passing!
Experiment
Final refactor
Caroline new
Caroline new
fixed query parameter bug
Video StoreWhat We're Looking For
|
| @@ -0,0 +1,93 @@ | |||
| class ApplicationController < ActionController::API | |||
|
|
|||
| def validate_query_params(acceptable_keys:) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting method!
| def get_active_rentals_from(instance:) | ||
| return instance.rentals.select { |rental| !rental.returned } | ||
| end | ||
|
|
||
| def get_past_rentals_from(instance:) | ||
| return instance.rentals.select { |rental| rental.returned } | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These seem like they should be model methods.
| @@ -0,0 +1,73 @@ | |||
| class RentalsController < ApplicationController | |||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be useful to move some of the business logic from this controller into model methods.
Video Store API
Congratulations! You're submitting your assignment!
If you didn't get to the functionality the question is asking about, reply with what you would have done if you had completed it.
Comprehension Questions
POST /rentals/check-inendpoint? What does the time complexity depend on? Explain your reasoning.