Skip to content

Commit

Permalink
Version 3.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Sep 12, 2021
1 parent b80fd08 commit b42bb0b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/tmp
erl_crash.dump
*.ez
/priv/plts

#### osx ####
*.DS_Store
Expand Down
12 changes: 4 additions & 8 deletions lib/ecto_autoslug_field/slug_generator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ defmodule EctoAutoslugField.SlugGenerator do
It is suited for inner use.
"""

alias Ecto.Changeset

import Ecto.Changeset,
only: [
put_change: 3,
Expand All @@ -17,9 +19,7 @@ defmodule EctoAutoslugField.SlugGenerator do
Default slug builder.
"""
@spec build_slug(Keyword.t(), Changeset.t()) :: String.t()
def build_slug(sources, _changeset) do
do_build_slug(sources)
end
def build_slug(sources, _changeset), do: do_build_slug(sources)

@doc """
This function conditionally generates slug.
Expand Down Expand Up @@ -96,10 +96,6 @@ defmodule EctoAutoslugField.SlugGenerator do
defp get_field_data(_, source, _) when is_binary(source), do: source

defp has_value?(nil), do: false

defp has_value?(string) when is_binary(string) do
String.trim(string) != ""
end

defp has_value?(string) when is_binary(string), do: String.trim(string) != ""
defp has_value?(_), do: true
end
5 changes: 4 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ defmodule EctoAutoslugField.Mixfile do
],

# Dialyzer:
dialyzer: [plt_add_deps: :apps_direct, plt_add_apps: [:ecto]]
dialyzer: [
plt_add_deps: :apps_direct,
plt_add_apps: [:ecto]
]
]
end

Expand Down

0 comments on commit b42bb0b

Please sign in to comment.