collectiveidea / interactor

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

context.fail! not working on Rails 6.0 #203

Open rbazinet opened 2 years ago

rbazinet commented 2 years ago

I am having an issue where I use an organizer with 6 interactors. If one of the interactors fails, I expect the rest to not be run.

I have code that calls context.fail! but it appears to not work with Rails 6. The exact same code works fine with Rails 5.2.x.

Anyone experience this problem?

d3mash commented 2 years ago

Hi! Can you please provide a reproducible snippet?

rstacruz commented 2 years ago

@rbazinet, I'm not sure about Rails 6, but there's an open issue about fail! errors that might be relevant: #170

aliahmadexe commented 1 year ago

@rbazinet hey! i upgraded my project from 5.2 to 6.1 and context.fail! is giving me undefined method `empty?' for nil:NilClass did you solve the problem in rails 6?

benjaminwil commented 1 year ago

I experienced this problem today while upgrading a project from Rails 5.2 to Rails 6.1. But in the end, it was because I upgraded the Ruby version to 2.7—not because of Rails 6 specifically.

A bundle update interactor (from v3.1.1 to v3.1.2) fixed the issue.

I expect it's because of this commit, which came in the 3.1.2 release.

Hope this helps someone. 👍