Skip to content

Commit

Permalink
faker: pin to 2.22.0
Browse files Browse the repository at this point in the history
We're hitting a Faker bug[1] that doesn't allow setting the locale in a
threaded environment (like Puma) so pin the version that does until
then.

[1]: faker-ruby/faker#2563
  • Loading branch information
freesteph committed May 22, 2023
1 parent 83011fc commit 6afb97e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source "https://rubygems.org"

gem "activesupport"
gem "factory_bot"
gem "faker"
gem "faker", "~> 2.22.0"
gem "puma"
gem "sinatra"
gem "sinatra-contrib"
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GEM
concurrent-ruby (1.2.2)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
faker (3.2.0)
faker (2.22.0)
i18n (>= 1.8.11, < 2)
i18n (1.13.0)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -46,7 +46,7 @@ PLATFORMS
DEPENDENCIES
activesupport
factory_bot
faker
faker (~> 2.22.0)
puma
sinatra
sinatra-contrib
Expand Down
2 changes: 2 additions & 0 deletions factories/student.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
require "faker"
require "ostruct"

Faker::Config.locale = :fr

FactoryBot.define do
factory :student, class: OpenStruct do # rubocop:disable Style/OpenStructUse
ine { Faker::Number.number(digits: 10) }
Expand Down

0 comments on commit 6afb97e

Please sign in to comment.