Module: RESTFramework::Mixins::DestroyModelMixin

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

Overview

Mixin for destroying records.

Instance Method Summary collapse

Instance Method Details

#destroyObject



811
812
813
814
# File 'lib/rest_framework/mixins/model_controller_mixin.rb', line 811

def destroy
  self.destroy!
  render(api: "")
end

#destroy!Object

Perform the ‘destroy!` call and return the destroyed (and frozen) record.



817
818
819
# File 'lib/rest_framework/mixins/model_controller_mixin.rb', line 817

def destroy!
  self.get_record.destroy!
end