-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Version 2.15.0 is broken by an I18n change #2202
Comments
@vbrazo +1 from me. |
@pond But as far as I can tell, your situation happens only when the given locale But could you teach me why is your application configured like that? |
Just to make sure, I confirmed that adding something like |
Have bumped up to 2.15.1 on our code base; this passed our large test suite via AWS CI in full - thanks for the quick action here, awesome stuff. @amatsuda Faker itself provides Our application has en-NZ available "in full" (e.g. in the server), but in the RSpec test suite does not necessarily always have that. I note a shorter list at some points in the test suite. Who knows why - that's what I mean when I refer to the difficulties involved with autoloading etc. in Rails. It doesn't matter if I use 2.15.0 or 2.15.1 in that case; one of our tests that fail in 2.15.0 and passes in 2.15.1 shows this:
Contrast with a debug halt during request processing in Puma:
All that aside, the real cause of the issue in our case was phone number generation. In order for Faker to build a phone number for a given locale, one must set Faker's locale - even though to the casual eye, no actual message lookup might be occurring (I presume in Faker's case it's looking up a format string).
I don't care if our application has I18n messages for en-NZ, I just want Faker to generate a New Zealand cellphone number, because it has that capability. Faker should make sure this works, IMHO, by ensuring the I18n system has load paths that include files apparently essential to Faker's operation. |
Describe the bug
2.14.0 -> 2.15.0 breaks internationalisation; the change in https://github.com/faker-ruby/faker/pull/2169/files is invalid.
To Reproduce
Gemfile:
Script:
Result with 2.14.0, or with 2.15.0 but with https://github.com/faker-ruby/faker/pull/2169/files reverted:
Result with 2.15.0 as released:
Expected behavior
The non-exception behaviour is expected.
Additional context
The old code was simple, terse and reliable - albeit heavy-handed! I certainly do appreciate the attempt to improve efficiency, but I think given the resulting high line count and complexity, coupled with the many issues around lazy loading etc. especially in very complex environments such as Rails, that reverting https://github.com/faker-ruby/faker/pull/2169/files could be the fastest way to resolve this until (or if) a more robust solution can be produced. In the mean time we are forced to hard-lock our
Gemfile
to precisely version 2.14.0.The text was updated successfully, but these errors were encountered: