You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment it's not possible to use unique-feature of faker.
To Reproduce
Factory.define(:company)do |f|
f.id{fake(:alphanumeric,:unique,:alpha,number: 3).upcase}# will failf.name{fake(:name,:name)}end
Expected behavior
id should be unique
Proposal
What do you think about following solution:
We could allow a unique-option at our DSL and if unique is set to true, the method unique is called in front of the specified method (alpha in this case)
Factory.define(:company)do |f|
f.id{fake(:alphanumeric,:alpha,number: 3,unique: true).upcase}# resulting call will be Faker::Alphanumeric.unique.alpha(number: 3)end
WDYT?
Thanks and best regards
The text was updated successfully, but these errors were encountered:
Describe the bug
At the moment it's not possible to use unique-feature of faker.
To Reproduce
Expected behavior
id should be unique
Proposal
What do you think about following solution:
We could allow a
unique
-option at our DSL and ifunique
is set to true, the methodunique
is called in front of the specified method (alpha
in this case)WDYT?
Thanks and best regards
The text was updated successfully, but these errors were encountered: