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



608
609
610
# File 'lib/rest_framework/controller_mixins/models.rb', line 608

def update
  return api_response(self.update!)
end

#update!Object

Perform the ‘update!` call and return the updated record.



613
614
615
616
617
# File 'lib/rest_framework/controller_mixins/models.rb', line 613

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