Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ config :coherence, TestCoherenceWeb.Endpoint,
config :coherence, ecto_repos: [TestCoherence.Repo]

config :coherence, TestCoherence.Repo,
adapter: Ecto.Adapters.Postgres,
username: System.get_env("DB_USERNAME") || "postgres",
password: System.get_env("DB_PASSWORD") || "postgres",
database: "coherence_test",
Expand Down
2 changes: 1 addition & 1 deletion lib/mix/tasks/coh.clean.ex
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ defmodule Mix.Tasks.Coh.Clean do

defp do_remove!(config, repo) do
ensure_repo(repo, [])
path = Path.relative_to(migrations_path(repo), Mix.Project.app_path())
path = Path.relative_to(Ecto.Migrator.migrations_path(repo), Mix.Project.app_path())

case Path.wildcard(path <> "/*coherence*") do
[] ->
Expand Down
2 changes: 1 addition & 1 deletion lib/mix/tasks/coh.install.ex
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ defmodule Mix.Tasks.Coh.Install do
path

_ ->
Path.relative_to(migrations_path(repo), Mix.Project.app_path())
Path.relative_to(Ecto.Migrator.migrations_path(repo), Mix.Project.app_path())
end

file = Path.join(path, "#{current_timestamp}_#{underscore(name)}.exs")
Expand Down
15 changes: 3 additions & 12 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,8 @@ defmodule Coherence.Mixfile do
def application do
[
mod: {Coherence, []},
applications: [
extra_applications: [
:logger,
:comeonin,
:ecto,
:elixir_uuid,
:phoenix_swoosh,
:timex_ecto,
:tzdata,
:plug,
:phoenix,
:phoenix_html
]
]
end
Expand All @@ -47,7 +38,8 @@ defmodule Coherence.Mixfile do

defp deps do
[
{:ecto, "~> 2.0"},
{:ecto, "~> 3.0"},
{:ecto_sql, "~> 3.0"},
{:comeonin, "~> 4.0"},
{:bcrypt_elixir, "~> 1.1"},
{:phoenix, "~> 1.3"},
Expand All @@ -56,7 +48,6 @@ defmodule Coherence.Mixfile do
{:elixir_uuid, "~> 1.2"},
{:phoenix_swoosh, "~> 0.2"},
{:timex, "~> 3.3"},
{:timex_ecto, "~> 3.3"},
{:floki, "~> 0.19", only: :test},
{:ex_doc, "~> 0.18.0", only: :dev},
{:earmark, "~> 1.2", only: :dev, override: true},
Expand Down
9 changes: 5 additions & 4 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
"comeonin": {:hex, :comeonin, "4.1.1", "c7304fc29b45b897b34142a91122bc72757bc0c295e9e824999d5179ffc08416", [:mix], [{:argon2_elixir, "~> 1.2", [hex: :argon2_elixir, repo: "hexpm", optional: true]}, {:bcrypt_elixir, "~> 0.12.1 or ~> 1.0", [hex: :bcrypt_elixir, repo: "hexpm", optional: true]}, {:pbkdf2_elixir, "~> 0.12", [hex: :pbkdf2_elixir, repo: "hexpm", optional: true]}], "hexpm"},
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm"},
"credo": {:hex, :credo, "0.10.0", "66234a95effaf9067edb19fc5d0cd5c6b461ad841baac42467afed96c78e5e9e", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
"db_connection": {:hex, :db_connection, "1.1.3", "89b30ca1ef0a3b469b1c779579590688561d586694a3ce8792985d4d7e575a61", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: true]}, {:sbroker, "~> 1.0", [hex: :sbroker, repo: "hexpm", optional: true]}], "hexpm"},
"db_connection": {:hex, :db_connection, "2.0.2", "440c05518b0bdca0469dafaf45403597430448c1281def14ef9ccaa41833ea1e", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm"},
"decimal": {:hex, :decimal, "1.5.0", "b0433a36d0e2430e3d50291b1c65f53c37d56f83665b43d79963684865beab68", [:mix], [], "hexpm"},
"dialyxir": {:hex, :dialyxir, "0.5.1", "b331b091720fd93e878137add264bac4f644e1ddae07a70bf7062c7862c4b952", [:mix], [], "hexpm"},
"earmark": {:hex, :earmark, "1.2.6", "b6da42b3831458d3ecc57314dff3051b080b9b2be88c2e5aa41cd642a5b044ed", [:mix], [], "hexpm"},
"ecto": {:hex, :ecto, "2.2.10", "e7366dc82f48f8dd78fcbf3ab50985ceeb11cb3dc93435147c6e13f2cda0992e", [:mix], [{:db_connection, "~> 1.1", [hex: :db_connection, repo: "hexpm", optional: true]}, {:decimal, "~> 1.2", [hex: :decimal, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.8.0", [hex: :mariaex, repo: "hexpm", optional: true]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: true]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.13.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:sbroker, "~> 1.0", [hex: :sbroker, repo: "hexpm", optional: true]}], "hexpm"},
"ecto": {:hex, :ecto, "3.0.2", "9d06ece60e2fc9b7593e74ede23747424ef32390016baca85cea3f4b84081c52", [:mix], [{:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: true]}], "hexpm"},
"ecto_sql": {:hex, :ecto_sql, "3.0.1", "7f0e123a3b4d3b8ac67da6ba3014c53dbed63e614c5086f3e99d01cab5defe27", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.0.2", [hex: :ecto, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.9.1", [hex: :mariaex, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.14.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.2.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"},
"elixir_make": {:hex, :elixir_make, "0.4.2", "332c649d08c18bc1ecc73b1befc68c647136de4f340b548844efc796405743bf", [:mix], [], "hexpm"},
"elixir_uuid": {:hex, :elixir_uuid, "1.2.0", "ff26e938f95830b1db152cb6e594d711c10c02c6391236900ddd070a6b01271d", [:mix], [], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.18.4", "4406b8891cecf1352f49975c6d554e62e4341ceb41b9338949077b0d4a97b949", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"},
Expand All @@ -35,11 +36,11 @@
"plug": {:hex, :plug, "1.6.2", "e06a7bd2bb6de5145da0dd950070110dce88045351224bd98e84edfdaaf5ffee", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}], "hexpm"},
"poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"},
"poolboy": {:hex, :poolboy, "1.5.1", "6b46163901cfd0a1b43d692657ed9d7e599853b3b21b95ae5ae0a777cf9b6ca8", [:rebar], [], "hexpm"},
"postgrex": {:hex, :postgrex, "0.13.5", "3d931aba29363e1443da167a4b12f06dcd171103c424de15e5f3fc2ba3e6d9c5", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 1.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm"},
"postgrex": {:hex, :postgrex, "0.14.0", "f3d6ffea1ca8a156e0633900a5338a3d17b00435227726baed8982718232b694", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.1", "28a4d65b7f59893bc2c7de786dec1e1555bd742d336043fe644ae956c3497fbe", [:make, :rebar], [], "hexpm"},
"swoosh": {:hex, :swoosh, "0.16.1", "bbe8e7fd90099ac9ad4c7ae751a003e1ecd5726962b26f13af7f95e741f81b5c", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.12", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, "~> 1.1", [hex: :mime, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm"},
"telemetry": {:hex, :telemetry, "0.2.0", "5b40caa3efe4deb30fb12d7cd8ed4f556f6d6bd15c374c2366772161311ce377", [:mix], [], "hexpm"},
"timex": {:hex, :timex, "3.3.0", "e0695aa0ddb37d460d93a2db34d332c2c95a40c27edf22fbfea22eb8910a9c8d", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 0.1.8 or ~> 0.5", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm"},
"timex_ecto": {:hex, :timex_ecto, "3.3.0", "d5bdef09928e7a60f10a0baa47ce653f29b43d6fee87b30b236b216d0e36b98d", [:mix], [{:ecto, "~> 2.2", [hex: :ecto, repo: "hexpm", optional: false]}, {:timex, "~> 3.1", [hex: :timex, repo: "hexpm", optional: false]}], "hexpm"},
"tzdata": {:hex, :tzdata, "0.5.17", "50793e3d85af49736701da1a040c415c97dc1caf6464112fd9bd18f425d3053b", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.3.1", "a1f612a7b512638634a603c8f401892afbf99b8ce93a45041f8aaca99cadb85e", [:rebar3], [], "hexpm"},
}
2 changes: 1 addition & 1 deletion test/schema_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ defmodule CoherenceTest.Schema do
assert cs.errors == [
password:
{"should be at least %{count} character(s)",
[count: 4, validation: :length, min: 4]}
[count: 4, validation: :length, kind: :min]}
]
end

Expand Down
2 changes: 1 addition & 1 deletion test/support/repo.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
defmodule TestCoherence.Repo do
use Ecto.Repo, otp_app: :coherence
use Ecto.Repo, otp_app: :coherence, adapter: Ecto.Adapters.Postgres
end
18 changes: 9 additions & 9 deletions test/support/schema.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defmodule TestCoherence.User do
end

@required_fields ~w(email name)a
@optional_fields ~w() ++ coherence_fields()
@optional_fields coherence_fields() |> Enum.map(&String.to_atom(&1))

def changeset(model, params \\ %{}) do
model
Expand All @@ -28,7 +28,7 @@ defmodule TestCoherence.User do
model
|> cast(
params,
~w(password password_confirmation reset_password_token reset_password_sent_at)
~w(password password_confirmation reset_password_token reset_password_sent_at)a
)
|> validate_coherence_password_reset(params)
end
Expand Down Expand Up @@ -63,7 +63,7 @@ defmodule TestCoherence.Invitation do

def changeset(model, params \\ %{}) do
model
|> cast(params, ~w(name email token))
|> cast(params, ~w(name email token)a)
|> validate_required([:name, :email])
|> unique_constraint(:email)
|> validate_format(:email, ~r/@/)
Expand Down Expand Up @@ -98,7 +98,7 @@ defmodule TestCoherence.Account do
model
|> cast(
params,
~w(password password_confirmation reset_password_token reset_password_sent_at)
~w(password password_confirmation reset_password_token reset_password_sent_at)a
)
|> validate_coherence_password_reset(params)
end
Expand Down Expand Up @@ -134,7 +134,7 @@ defmodule TestCoherence.Coherence.User do
model
|> cast(
params,
~w(password password_confirmation reset_password_token reset_password_sent_at)
~w(password password_confirmation reset_password_token reset_password_sent_at)a
)
|> validate_coherence_password_reset(params)
end
Expand All @@ -155,7 +155,7 @@ defmodule TestCoherence.Coherence.Invitation do

def changeset(model, params \\ %{}) do
model
|> cast(params, ~w(name email token))
|> cast(params, ~w(name email token)a)
|> validate_required([:name, :email])
|> unique_constraint(:email)
|> validate_format(:email, ~r/@/)
Expand All @@ -180,7 +180,7 @@ defmodule TestCoherence.Coherence.Account do
end

@required_fields ~w(email name)a
@optional_fields ~w() ++ coherence_fields()
@optional_fields coherence_fields() |> Enum.map(&String.to_atom(&1))

def changeset(model, params \\ %{}) do
model
Expand All @@ -194,7 +194,7 @@ defmodule TestCoherence.Coherence.Account do
model
|> cast(
params,
~w(password password_confirmation reset_password_token reset_password_sent_at)
~w(password password_confirmation reset_password_token reset_password_sent_at)a
)
|> validate_coherence_password_reset(params)
end
Expand All @@ -220,7 +220,7 @@ defmodule TestCoherence.Coherence.Rememberable do

def changeset(model, params \\ %{}) do
model
|> cast(params, ~w(series_hash token_hash token_created_at user_id))
|> cast(params, ~w(series_hash token_hash token_created_at user_id)a)
|> validate_required(~w(series_hash token_hash token_created_at user_id)a)
end

Expand Down