-
Notifications
You must be signed in to change notification settings - Fork 87
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
Migration fails and more problems due to method_missing #15
Comments
The However, I did just change Also: Sorry for the long response time. |
Yes, I am aware that the dynamic finders that method_missing are falling out of favor. Imho named arguments turn out to be more readable than find_by_this_and_than_and_y_and_z. Without the trouble that overwriting method missing brings along. At any rate. I tried the current commit of textacular on github and our project still fails when running the migrations with it. I created a branch from the failing commit if you want too look in to it: https://github.com/zhdk/madek/tree/textacular |
Hmm. I checked it out and had a look at the stack trace. It didn't look like textacular was specifically implicated:
However, if removing this gem fixes it, then that's telling. I'm not sure how to go about figuring out how to fix it, so I'll open a new Issue specifically to discuss removing the dynamic method feature. Obviously, that would require a major version bump, too, so we're not looking at the next release for this. |
@DrTom I cloned that repo and ran the migrations with the master of textacular without any issue. |
Oh. @DrTom: What version of Ruby are you using? That might matter, too. |
It is failing for me too. I use the same patchlevel of ruby 2 as you. It is a very weird error. I will try to find where it is originated from. |
I tried to get to the bottom of this but no luck so far. It brakes at the override of |
I might be wrong but at this line https://github.com/textacular/textacular/blob/master/lib/textacular.rb#L56 should we check if it is an return super if self != ActiveRecord::Base @benhamill do you think this would be a good fix? I can commit the changes if you think it is ok. |
That Ignoring the test for the moment, if the class in question is But I feel like I might just be misunderstanding something about what you're saying. |
You are right it was late and I haven't think it through. Oddly enough if I do the change above to textacular in DrTom's app the migrations are working and even the dynamic helpers. Not sure how :) . |
I eliminated a few suspicious gems but the migration still fails. So, we know that there is some unfortunate interaction between textacular and some other gem that overwrites I will use my patched version of textacular without the overwritten |
I'm gonna go ahead and close this. I just merged #16, which deprecates the dynamic helpers. In the next major version bump, we'll rip 'em out. |
We had a several problems using textacular, i.e. migrations would fail. It turned out to be the implementation of method_missing in textacular.
I forked the project and simply removed method_missing which fixes the issues for us:
https://github.com/DrTom/textacular
It is up to you how to fix the problem but I kindly suggest not to overwrite method_missing as the troubles that come with it are often not worth the benefits.
The text was updated successfully, but these errors were encountered: