-
Notifications
You must be signed in to change notification settings - Fork 9
Macro::ModelDestroy
Vladislav Trotsenko edited this page Sep 27, 2019
·
1 revision
Provides to destroy last model in chain.
class SomeOperation < ApplicationOperation
step ->(ctx, **) { ctx[:some_model] = SomeModel.create }
step Macro::ModelDestroy(path: %i[some_model]) # ctx[:some_model].destroy
end
class SomeOperation < ApplicationOperation
step ->(ctx, **) { ctx[:some_model] = SomeModel.create }
step Macro::ModelDestroy(path: %i[some_model some_relation]) # ctx[:some_model].some_relation.destroy
end
RubyGarage is a leading software development and consulting company in Eastern Europe. Our main expertise includes Ruby and Ruby on Rails, but we successfully employ other technologies to deliver the best results to our clients. Check out our portfolio for even more exciting works!