Conversation
…al, customer. relate rentals to customer and video
…h their tests for video and customer
…w on video controller, created customer yaml
… and check out. updated rental validation for numercality. messed up rental controller tests
Co-authored-by: yieknee <52982163+yieknee@users.noreply.github.com>
Video Store APIMajor Learning Goals/Code Review
Functional Requirements
Overall Feedback
Additional FeedbackGreat work! Y'all built a fully functional API! Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
| @@ -0,0 +1,34 @@ | |||
| class Rental < ApplicationRecord | |||
There was a problem hiding this comment.
Both of the custom methods here are so well-written!
| self.available_inventory = video.available_inventory | ||
| self.videos_checked_out_count = customer.videos_checked_out_count |
There was a problem hiding this comment.
The redundancy of putting these two fields on rental to mirror the fields on video and customer introduces the risk that a bug could get introduced to cause them to go out of sync. If they did go out of sync, how should the system respond to that? Which number should it trust?
Because of that, it's generally best practice not to have redundant values intended to track the same information.
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.