I am trying to get the result of the process method to be part of the to_json
. I've tried overriding the to_json
method and introducing a representer. However I can't get access to the return in any of them
class TestOperation < Trailblazer::Operation
def process(params)
validate(params)
m = TestModel.new
m.build_stuff
m.result
end
end
When I run the following I need to result of the process
op = TestOperation.call(params)
puts op.to_json