From cf23ce649a4cdeece861ad26851a0a97017919c7 Mon Sep 17 00:00:00 2001 From: Martin Nijboer Date: Sat, 17 Jun 2023 22:40:16 +0200 Subject: [PATCH] Export unique_integer/0 and unique_uuid/0 --- CHANGELOG.md | 4 ++++ lib/factoid.ex | 12 +++++++++++- mix.exs | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bf8031..fd95b07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.1.2 + +- Export unique_integer/0 and unique_uuid/0 + # 0.1.1 - Updated documentation diff --git a/lib/factoid.ex b/lib/factoid.ex index 6adab78..6f7e122 100644 --- a/lib/factoid.ex +++ b/lib/factoid.ex @@ -105,7 +105,7 @@ defmodule Factoid do @doc false defmacro __using__(opts) do quote bind_quoted: [opts: opts] do - import Factoid + import Factoid, only: [insert: 4] @repo Keyword.get(opts, :repo) @@ -125,6 +125,16 @@ defmodule Factoid do def insert(factory_name, attrs \\ %{}) do insert(@repo, factory_name, &build/2, attrs) end + + @doc """ + Generates a systemically unique integer. + """ + def unique_integer, do: Factoid.unique_integer() + + @doc """ + Generates a UUID. + """ + def unique_uuid, do: Factoid.unique_uuid() end end diff --git a/mix.exs b/mix.exs index c53a630..7d35a1d 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Factoid.MixProject do use Mix.Project - @version "0.1.1" + @version "0.1.2" @source_url "https://github.com/recruiterbay/factoid" @changelog_url "https://github.com/recruiterbay/factoid/blob/main/CHANGELOG.md"