Skip to content
Vladislav Trotsenko edited this page Sep 27, 2019 · 1 revision

Synopsis

Provides to delete last model in chain.

Examples of usage

Without chain

class SomeOperation < ApplicationOperation
  step ->(ctx, **) { ctx[:some_model] = SomeModel.create }
  step Macro::ModelDelete(path: %i[some_model]) # ctx[:some_model].delete
end

With chain

class SomeOperation < ApplicationOperation
  step ->(ctx, **) { ctx[:some_model] = SomeModel.create }
  step Macro::ModelDelete(path: %i[some_model some_relation]) # ctx[:some_model].some_relation.delete
end
Clone this wiki locally