-
Notifications
You must be signed in to change notification settings - Fork 38
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
Fix stack exception when calling translates
multiple times
#50
base: master
Are you sure you want to change the base?
Conversation
…late into Leadformance-master
ping @lminaudier ? I think that this is a huge improvement, because using Also, Test has been fixed to avoid crashing in 1.9.3. |
ping @robworley ? :) |
Hi @odarriba, First; thanks for the report and the PR. Then, by any chance could you add some specs ? |
@lminaudier there you go! I've added specs to test that a model that have called Hope this helps :) Thanks for the reply! |
Any news on this? |
@lminaudier any news? Is there any chance to maintain and improve this gem? |
I couldn't reproduce (and apparently the test provided doesn't fail either without your fix). Could you please try again? |
In a project I'm working on, I have this models:
As you can see, I'm using Single Table Inheritance to store different kind of Objects in the same table. As I want to translate both fields, I have to call
translates
method two times (I could call it only once inObject
class, but:wadus
field it's supposed to be only unTable
model).This causes an
alias_method
loop that ends in anStack level too deep
exception. To fix it, I've create a patch that verifies if the model already has translated attributes, in which case avoids creating the aliases, so this loop never happens.And thanks for your work in this gem, it's awesome!