-
Notifications
You must be signed in to change notification settings - Fork 147
Description
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.