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



778
779
780
# File 'lib/rest_framework/mixins/model_controller_mixin.rb', line 778

def update
  render(api: self.update!)
end

#update!Object

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



783
784
785
786
787
# File 'lib/rest_framework/mixins/model_controller_mixin.rb', line 783

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