-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Callbacks are not inherited #114
Comments
Could you write a test to expose this issue? |
I can confirm inheritance doesn't work on hooks. Any update on the fix? |
@aandis There are no updates on this from maintainers. But just yesterday, we solved this problem at our company using the method mentioned in the PR description (using |
Here is a test case: require 'interactor'
class ABC
include Interactor
around :do_it
def do_it(interactor)
p "doing it"
interactor.call
p "done it"
end
end
class DoIt < ABC
def call
p "calling DoIt"
end
end
DoIt.call
class DoItAgain < ABC
around :do_it
def call
p "calling DoItAgain"
end
end
DoItAgain.call Output:
Expected Output:
Gemfile used:
|
+1, still an issue on the latest version 😕 |
Still an issue 7 years later... |
I'm rewriting my API layer to use interactors and I noticed callbacks defined on an interactor are not inherited by its children. Is this the desired behavior?
For the moment, this works fine:
The text was updated successfully, but these errors were encountered: