-
Notifications
You must be signed in to change notification settings - Fork 31
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
Incompatible with schema_plus #19
Comments
Thanks for reporting, I'll look into this. |
With newer versions of Schema Plus, specifically SchemaPlus/schema_monkey#6, db:load/db:reset and friends will cause an infinite recursion. I hypothesise it's due to alias_method_chain being called to early, @ronen and I are looking into this; if that is indeed the problem, would switching over to module includes be okay with you @pinnymz? If that doesn't work (hence the use of |
I'm all for moving to Ruby 2.0 to keep the code lean, and that would include removing For the time being, I don't see how using Module includes would solve the problem. Can you possibly provide a sample of such code that demonstrates this? |
I'm not sure of the exact priority rules for prepend vs include (but I vaguely remember that it's prepended modules [last prepended first], then the class, then included modules [last included first]). So if a class has a method that is implemented only in a module, including a new module does replace the existing implementation, with the old implementation accessible via ActiveRecord does this, so it might not require a prepend. |
@pinnymz, @lowjoel: confirming it's a small rewrite to change from Personally I'd recommend using But... @pinnymz Another thing to consider if you were interested: Re-implement migration_comments on top of schema_plus's infrastructure: schema_plus_core and schema_monkey. I think it would fit right in. Those take care of all the monkey patching to provide an extension API for rails, letting you drop in enhancements like this as middleware without needing to do all that monkey patching yourself. It'd of course be a bigger change to the code base, which would doubtless give you pause. But once changed there'd actually be much less code, and you'd get upwards-compatibility with future releases of ActiveRecord "for free" when schema_plus_core updates accordingly. If that's something you're interested in, I'm happy to answer any questions you may have. |
I think I can push a PR to move this to prepend and super, breaking 1.9 compatibility. @pinnymz would you be okay with it? If you'd like to use the schema_monkey and schema_plus_core gems, with stuff written using modules+prepend should make it easier to migrate to anyway. |
OK, let me know how it goes. |
@pinnymz we never did have that conversation... still interested? |
@ronen this now seems to be moot, as Rails 5 will be supporting comments. Thanks for the offer, though. |
Note that as per SchemaPlus/schema_monkey#13 these gems are compatible but they need to be required in the proper order. |
It appears as if this gem has problems when also used with schema_plus and when both have options for the same column. I'm not sure which gem has a bug; so I also posted an issue over there.
See SchemaPlus/schema_plus#170
Also see that issue for additional details and examples.
The text was updated successfully, but these errors were encountered: