Skip to content
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

Value at a parent node crashes the app #82

Open
nvanoorschot opened this issue May 19, 2017 · 0 comments
Open

Value at a parent node crashes the app #82

nvanoorschot opened this issue May 19, 2017 · 0 comments

Comments

@nvanoorschot
Copy link

In my db I had the following two keys with a value:

"activerecord.models.resource.name"
"activerecord.models.resource.name.one"

This was my own fault and had nothing to do with this gem. But the result is that my Rails app crashed and that I got a undefined method 'split' for nil:NilClass error that took me too long to track down This was of course a case of GIGO but still it would be nice if this gem would not produce an obscure error message.

In my fork I implemented a simple solution that silently ignores the result of the parent and only returns the children. This makes for a more forgiving gem, which I would prefer. Disadvantage here is that you might end up with unreachable translations in your db as soon as you turn a child node into a parent node.

Another approach would be to raise a specific error revealing the cause of the problem.

I'll submit a PR with my fix, but if a different solution is preferred I can have a look at it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant