collectiveidea / interactor

Interactor provides a common interface for performing complex user interactions.
MIT License
3.36k stars 212 forks source link

Organizers don't return context #94

Closed mingan closed 9 years ago

mingan commented 9 years ago

I've updated from version 2 to 3 in our application. I've changed all new + perform to call which seems to be reasonable, but I've found one confusing aspect.

Before, I would create an instance of an organizer, pass it context, call perform and then ask for success? as I would with a normal interactor. Now I use call instead which returns context for interactors (which I can simply query) but call on organizer returns nothing (it is even the comment) and I have to then go and ask for the context explicitly first:

organizer = Organizer.call(some: data)
if organizer.context.success?
    ...
end

I believe the API should be unified and organizer should return context like interactors do.

mingan commented 9 years ago

I apologize, my mistake :blush:. Was debugging one situation and looking at the code of another, I had a mixed usage in there.