Conversation
kaidamasaki
left a comment
There was a problem hiding this comment.
Great job! I really don't have very many notes on your project, it was very clean and well implemented. 😃
|
|
||
| if rental.save | ||
| customer.check_out_increase | ||
| customer.save |
There was a problem hiding this comment.
This is a redundant save.
(check_out_increase already saves the model.)
Video Store APIMajor Learning Goals/Code Review
Functional Requirements
Overall Feedback
Comprehension Questions
This is a O(n * log(n)) operation if you do not have an index (since the database uses an efficient sort). If you created an index via a migration though then it would become a O(n) operation since the database index lets you go through a table in order in a single pass. (If you ordered by
This is a good intuition. However databases can do even better than O(n) here. Because of how databases store keys (in a tree, specifically a B-Tree) searching for a foreign key with an index on it will be O(log(n)). This is why it's important to add a reference in your migrations in addition to just adding a Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
Assignment Submission: Video Store API
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
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.
Reflection
/customers&/videosendpoints? What does the time complexity depend on? Explain your reasoning.POST /rentals/check-inendpoint? What does the time complexity depend on? Explain your reasoning.