-
Notifications
You must be signed in to change notification settings - Fork 69
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
amoeba method doesn't deal with class hierarchies correctly #1
Comments
Actually, I realize you can't write it using "super.amoeba", its in the wrong context. So the problem remains - how to share parent class configuration in the child class w/o repeating yourself. |
Actually, it's more complex than that. Consider:
but if I name the association explicitly, it works:
|
hey, thanks for the feedback, I'll have a look at this as soon as I can. please feel free to fork it and submit a pull request with a solution if you like :) |
hey rob... I just pushed some changes that I hope address the issues you were facing. I've updated the docs and added some tests and at a cursory glance, so far, without delving too deep - it seems to be working. all you should have to do is add like this:
please give it a try and let me know if it works for you. I haven't pushed up to rubygems yet, and even when I do it sometimes takes time for the new version to propagate, so please just try the gem from git HEAD and let me know how it goes. enjoy :) |
ok, pushed to rubygems |
hey, that's great response. when I check it out, I'll be sure to retract my On Sat, Mar 24, 2012 at 8:02 PM, Vaughn Draughon <
|
closing this issue for now since it seems to work for me |
np On Mon, Mar 26, 2012 at 7:24 PM, Vaughn Draughon <
|
If you have have:
and then following code fails:
The reason is that the Amoeba::Config in the EnhancedPost class has enabled=false (the default) b/c it is not the same instance as the Amoeba::Config in the Post base class.
I'm thinking that the amoeba block in EnhancedPost should perhaps be written this way:
and I'm wishing that you could include a note about the behaviour of Amoeba and inherited classes in your wonderful documentation, it took two of us quite a few hours to figure out what was happening.
Thanks!
Rob.
The text was updated successfully, but these errors were encountered: