-
Notifications
You must be signed in to change notification settings - Fork 75
Devices API #1699
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
Devices API #1699
Conversation
6563a42
to
01e3c32
Compare
This reverts commit 9d5bda3.
@@ -39,7 +32,11 @@ def device | |||
|
|||
def device_params | |||
params.require(:device).permit( | |||
:device_type, :name, :serial_number, specifications: {} | |||
add_devices: [:device_type, :name, :serial_number, :is_insured, :insurance_bought_date, :insurance_expiry_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.
expected_attributes = [:device_type, :name, :serial_number, :is_insured, :insurance_bought_date, :insurance_expiry_date, specifications: [:processor, :ram, :graphics]]
add_devices: expected_attributes,
update_devices: expected_attributes + [:id]
remove_devices: []
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.
done
app/models/device.rb
Outdated
# user_id :bigint not null | ||
# id :bigint not null, primary key | ||
# device_type :string default("laptop") | ||
# insurance_bought_date :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.
Is insurance_bought_date == insurance_start_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.
using insurance_activation_date now
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.
Are we maintaining histories of insurance? Anyways, We can tackle it in a new PR.
Rest LGTM!
This reverts commit 2b874c7.
What