     assert Map.drop(version, [:id]) == %{
       event: "update",
       item_type: "Person",
-      item_id: Repo.one(first(Person, :id)).id,
+      item_id: first_person.id,
       item_changes: %{
         first_name: "Isaac",
         visit_count: 10,

    Repo.delete_all(Company)
    Repo.delete_all(PaperTrail.Version)

    Company.changeset(%Company{}, %{
      name: "Acme LLC",
      website: "http://www.acme.com"
    }) |> Repo.insert

    Company.changeset(%Company{}, %{
      name: "Another Company Corp.",
      is_active: true,
      address: "Sesame street 100/3, 101010"
    }) |> Repo.insert

    :ok
  end

  test "creating a person with meta tag creates a person version with correct attributes" do
    company = first(Company, :id) |> Repo.one

    new_person = Person.changeset(%Person{}, %{
      first_name: "Izel",
      last_name: "Nakri",
      gender: true,
      company_id: company.id
    })

    {:ok, result} = PaperTrail.insert(new_person, origin: "admin", meta: %{}) # add link name later on

    person_count = Repo.all(
      from person in Person,
      select: count(person.id)
    )

    person = result[:model] |> Map.drop([:__meta__, :__struct__, :inserted_at, :updated_at, :id])

    version_count = Repo.all(
      from version in PaperTrail.Version,
      select: count(version.id)
    )

    version = result[:version] |> Map.drop([:__meta__, :__struct__, :inserted_at])

    assert person_count == [1]
    assert version_count == [1]

    }
  end

  test "[multi tenant] updating a person creates a person version with correct attributes" do
    first_person = QueryHelper.first_person() |> Repo.one()

    target_company =
      [name: "Another Company Corp.", limit: 1]
      |> QueryHelper.filter_company()
      |> Repo.one()

    {:ok, result} =
      ChangesetHelper.update_person(first_person, %{
        first_name: "Isaac",
        visit_count: 10,
        birthdate: ~D[1992-04-01],
        company_id: target_company.id
      })
      |> PaperTrail.update(origin: "user:1", meta: %{linkname: "izelnakri"})

    person_count = QueryHelper.person_count() |> Repo.all()
    version_count = QueryHelper.version_count() |> Repo.all()

    person = result[:model] |> Map.drop([:__meta__, :__struct__, :inserted_at, :updated_at, :id])
    version = result[:version] |> Map.drop([:__meta__, :__struct__, :inserted_at])

    assert person_count == [1]
