-
Notifications
You must be signed in to change notification settings - Fork 25
Daniela and Laura Video Store #3
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
Video StoreWhat We're Looking For
|
| # info << Movie.find_by(id: params[:id]).rentals.where(active:true) #name #postal_code | ||
| if movie | ||
| rentals = movie.rentals.where(active:true) | ||
| if rentals |
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.
Since rentals will be a collection, this should probably be if rentals.length > 0
| # info << Movie.find_by(id: params[:id]).rentals.where(active:true) #name #postal_code | ||
| if movie | ||
| rentals = movie.rentals.where(active:false) | ||
| if rentals |
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.
similar to above
|
|
||
| if rentals.any? | ||
| overdues = [] | ||
| rentals.each do |rental| |
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.
This type of method would make an excellent model method.
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.