Rails Grape API Endpoint optional params validation in update
user.assign_attributes(params)
user.save


model.assign_attributes(hash) allows you to assign a key value hash to your ActiveRecord object. The only caveat is that the keys passed must correspond to your columns or an exception will be raised. You will need to call .save to persist the changes.

If you want to assign and save in one fell stroke, use model.update(hash).

http://api.rubyonrails.org/classes/ActiveRecord/AttributeAssignment.html