diff --git a/README.md b/README.md index 0532ff75..c45add66 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,7 @@ defmodule Repo.Migrations.AddVersions do def change do create table(:companies) do add :name, :string, null: false - add :founded_in, :string + add :founded_in, :date # null constraints are highly suggested: add :first_version_id, references(:versions), null: false @@ -214,7 +214,7 @@ defmodule Company do schema "companies" do field :name, :string - field :founded_in, :string + field :founded_in, :date belongs_to :first_version, PaperTrail.Version belongs_to :current_version, PaperTrail.Version, on_replace: :update # on_replace: is important! diff --git a/lib/paper_trail.ex b/lib/paper_trail.ex index 515ff9c5..f30e39ca 100644 --- a/lib/paper_trail.ex +++ b/lib/paper_trail.ex @@ -160,7 +160,6 @@ defmodule PaperTrail do end end - defp make_version_struct(event_list, model, options \\ []) defp make_version_struct(%{event: "insert"}, model, options) do %Version{ event: "insert", diff --git a/mix.exs b/mix.exs index 78142251..7000f4df 100644 --- a/mix.exs +++ b/mix.exs @@ -4,8 +4,8 @@ defmodule PaperTrail.Mixfile do def project do [ app: :paper_trail, - version: "0.5.3", - elixir: "~> 1.3", + version: "0.6.0", + elixir: "~> 1.4", description: description(), build_embedded: Mix.env == :prod, start_permanent: Mix.env == :prod, diff --git a/test/paper_trail_strict_mode_test.exs b/test/paper_trail_strict_mode_test.exs index 8cc15760..3d7441fc 100644 --- a/test/paper_trail_strict_mode_test.exs +++ b/test/paper_trail_strict_mode_test.exs @@ -188,7 +188,7 @@ defmodule PaperTrailStrictModeTest do test "PaperTrail.delete\\2 with an error returns and error tuple like Repo.delete\\2" do {:ok, insert_company_result} = create_company_with_version() - {:ok, insert_person_result} = Person.changeset(%Person{}, %{ + Person.changeset(%Person{}, %{ first_name: "Izel", last_name: "Nakri", gender: true, diff --git a/test/paper_trail_test.exs b/test/paper_trail_test.exs index 6a9e379f..2195f6c9 100644 --- a/test/paper_trail_test.exs +++ b/test/paper_trail_test.exs @@ -175,7 +175,7 @@ defmodule PaperTrailTest do test "PaperTrail.delete\\2 with an error returns and error tuple like Repo.delete\\2" do {:ok, insert_company_result} = create_company_with_version() - {:ok, insert_person_result} = Person.changeset(%Person{}, %{ + Person.changeset(%Person{}, %{ first_name: "Izel", last_name: "Nakri", gender: true, diff --git a/test/test_helper.exs b/test/test_helper.exs index 16d97f5b..f224b87f 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -8,7 +8,6 @@ defmodule User do use Ecto.Schema import Ecto.Changeset - import Ecto.Query schema "users" do field :token, :string