Module: RESTFramework::Mixins::UpdateModelMixin

Included in:
ModelControllerMixin
Defined in:
lib/rest_framework/mixins/model_controller_mixin.rb

Overview

Mixin for updating records.

Instance Method Summary collapse

Instance Method Details

#updateObject



674
675
676
# File 'lib/rest_framework/mixins/model_controller_mixin.rb', line 674

def update
  return api_response(self.update!)
end

#update!Object

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



679
680
681
682
683
# File 'lib/rest_framework/mixins/model_controller_mixin.rb', line 679

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