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



261
262
263
264
265
# File 'lib/rest_framework/controller_mixins/models.rb', line 261

def _update
  @record = self.get_record
  @record.update!(self.get_update_params)
  return self.get_serializer_class.new(@record, controller: self).serialize
end

#updateObject



257
258
259
# File 'lib/rest_framework/controller_mixins/models.rb', line 257

def update
  api_response(self._update)
end