forked from rubygarage/boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Macro::ModelDelete
Vladislav Trotsenko edited this page Oct 21, 2020
·
1 revision
Provides to delete last model in chain.
class SomeOperation < ApplicationOperation
step ->(ctx, **) { ctx[:some_model] = SomeModel.create }
step Macro::ModelDelete(path: %i[some_model]) # ctx[:some_model].delete
end
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