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

#updateObject



418
419
420
# File 'lib/rest_framework/controller_mixins/models.rb', line 418

def update
  return api_response(self.update!)
end

#update!Object

Helper to perform the `update!` call and return the updated record.



423
424
425
426
427
# File 'lib/rest_framework/controller_mixins/models.rb', line 423

def update!
  record = self.get_record
  record.update!(self.get_update_params)
  return record
end