-
Notifications
You must be signed in to change notification settings - Fork 629
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
Issue with Subclass trying to use the Superclass state machine #64
Comments
For now I've fixed it adding this code:
I know it's not ideal and there is most likely a better way. |
Subclassing is supported in AASM, and its specs show that it works. But there might be a case in your code, which is not covered yet. I will try to reproduce your error by adding a test. Maybe you can help me with that, any broken spec is appreciated! |
Do you have the full backtrace for me? |
@alto I've added a test to I see the test passing in my local environment, but then I go to my project and it still fails if I remove this from the subclass:
I guess it's an issue with my dependencies. I am still investigating. |
Keep me up-to-date with this, please! If I can help you with anything, let me know. |
@etagwerker Did you find anything causing the trouble? |
@alto Sorry, no. I am still using this in the
|
That's not good. Anything I can do? |
No, I'm closing this issue until I have more info. |
Hello,
It seems that subclassing is supported by
aasm
but I am getting an error which seems to be related to this.I am getting:
My code looks like this:
After debugging the code, I see that
aasm
is looking for the state machine insideSubclass
and not finding it, as intended (or finding an empty state machine)So, when it looks for the event
add_details
it is not finding it and then raising theundefined method
error.What's the expected behavior here? Is this correct or a bug?
I would expect
aasm
to be smart enough to know that:Subclass
Superclass
Maybe there is something I am doing wrong.
Proposed solutions:
A. Add an inheritance section in the README
B. Change the way
aasm
looks up the state machineI'd appreciate your feedback.
Thanks!
The text was updated successfully, but these errors were encountered: