-
Notifications
You must be signed in to change notification settings - Fork 27
Time - Olga & Quin #5
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
… a failed video controller test
Fixed the bug. It was impossible to find a Rental by a video and customer id
Tests for rental check-in
Video Store APIMajor Learning Goals/Code Review
Functional Requirements
Overall Feedback
Comprehension Questions
Because you created indexes for these this actually winds up being a O(log(n)) operation, which is pretty efficient. It would be O(n) if you hadn't created indexes on your foreign keys. (Databases use B-Trees for things like indexes, hence the logarithmic search.) Code Style Bonus AwardsWas the code particularly impressive in code style for any of these reasons (or more...?)
|
kaidamasaki
left a comment
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.
Excellent job! I really like how you handled your check in/out. It's very clean and elegant.
I've got a few style notes but other than that everything looks great!
| @@ -0,0 +1,12 @@ | |||
| class Customer < ApplicationRecord | |||
| has_many :rentals | |||
| has_many :videos, :through => :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.
Style: I'd probably update this line to match the ones below.
| has_many :videos, :through => :rentals | |
| has_many :videos, through: :rentals |
| belongs_to :customer | ||
| belongs_to :video | ||
|
|
||
| def self.inventory_check_out(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.
Style: I would have made these instance methods since you pass an instance in anyway.
| return true | ||
| else | ||
| return false |
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.
I really like returning a boolean value to indicate success or failure here though.
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.