Class: Macros::Model::Destroy

Inherits:
Base
  • Object
show all
Defined in:
lib/macros/model/destroy.rb

Overview

Destroy step for removing object assigned in ctx

Examples:

step Macros::Model::Destroy()

Instance Method Summary collapse

Methods inherited from Base

#initialize, register

Constructor Details

This class inherits a constructor from Macros::Base

Instance Method Details

#call(_ctx, model:) ⇒ Object

Destroys a given model

Parameters:

  • _ctx (Trailblazer::Skill)

    context accumulator

  • model (Object)

    object that we want to destroy



12
13
14
15
# File 'lib/macros/model/destroy.rb', line 12

def call(_ctx, model:, **)
  model.destroy
  model.destroyed?
end