-
Notifications
You must be signed in to change notification settings - Fork 25
Ungco/Metzner - VideoStoreAPI #7
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
…d called the method in the rentals, movies and customer controllers
…ould be sorted by movie titles and customer names
…ustomer name in the rentals
Video StoreWhat We're Looking For
|
| belongs_to :movie | ||
| belongs_to :customer | ||
|
|
||
| before_create :set_default_to_checkin_date |
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.
Good find!
| @@ -0,0 +1,25 @@ | |||
| class ApplicationController < ActionController::API | |||
|
|
|||
| def sort(list, params, sort_params, fields, method: nil) | |||
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.
Good use of the ApplicationController. Should it be private?
| class CustomersController < ApplicationController | ||
| @@fields = [:id, :name, :register, :postal_code, :phone, :registered_at] | ||
| @@method = :movies_checked_out_count | ||
| @@sort_params = ['name', 'registered_at', 'postal_code'] |
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.
In general don't make class variables in Rails controllers. It's a bad practice. Constants are fine
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.