Skip to content

Option to make any generated data unique #479

@chvanikoff

Description

@chvanikoff

From project to project, I keep bringing my tiny function of making generated data unique:

def make_unique(string) do
  "#{string}#{System.unique_integer([:positive, :monotonic])}"
end

make_unique(Faker.Pokemon.name())

While it's really tiny, I thought what if we had an option to pass extra opts, like unique: true, to any of the Faker modules functions? i.e., Faker.For example, Pokemon.name(unique: true) would generate Pikachu42.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions