Module: RESTFramework::UpdateModelMixin
- Included in:
- ModelControllerMixin
- Defined in:
- lib/rest_framework/controller_mixins/models.rb
Overview
Mixin for updating records.
Instance Method Summary collapse
Instance Method Details
#update ⇒ Object
283 284 285 |
# File 'lib/rest_framework/controller_mixins/models.rb', line 283 def update api_response(self.update!) end |
#update! ⇒ Object
287 288 289 290 291 |
# File 'lib/rest_framework/controller_mixins/models.rb', line 287 def update! @record ||= self.get_record @record.update!(self.get_update_params) return self.serialize(@record) end |