mirror of
https://github.com/sloanelybutsurely/typeid-elixir.git
synced 2024-11-28 01:42:54 -05:00
fix: raise if primary_key: true and no prefix (#22)
This commit is contained in:
parent
c9eb03b44e
commit
dd8f957106
3 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,9 @@
|
|||
# Changelog
|
||||
|
||||
## 0.5.1
|
||||
|
||||
- raises if `prefix` is not given when `primary_key: true`
|
||||
|
||||
## 0.5.0
|
||||
|
||||
- `Ecto.ParameterizedType` implementation traverses associations so prefixes only need to be defined on schema primary keys
|
||||
|
|
|
@ -86,7 +86,7 @@ if Code.ensure_loaded?(Ecto.ParameterizedType) do
|
|||
field = Keyword.fetch!(opts, :field)
|
||||
default_type = Application.get_env(:typeid_elixir, :default_type, :string)
|
||||
type = Keyword.get(opts, :type, default_type)
|
||||
prefix = Keyword.get(opts, :prefix, "")
|
||||
prefix = Keyword.get(opts, :prefix)
|
||||
|
||||
if primary_key do
|
||||
unless prefix && prefix =~ ~r/^[a-z]{0,63}$/ do
|
||||
|
|
2
mix.exs
2
mix.exs
|
@ -1,7 +1,7 @@
|
|||
defmodule TypeID.MixProject do
|
||||
use Mix.Project
|
||||
|
||||
@version "0.5.0"
|
||||
@version "0.5.1"
|
||||
|
||||
def project do
|
||||
[
|
||||
|
|
Loading…
Reference in a new issue