Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo get/set doesn't handle :datetime fields using DateTime structs #82

Open
mangr3n opened this issue Jun 17, 2020 · 1 comment
Open

Comments

@mangr3n
Copy link

mangr3n commented Jun 17, 2020

See my Pull Request to see a test that demonstrates the problem.

I modified the schema definition thus

defmodule Dlex.User do
  use Dlex.Node

  schema "user" do
    field :name, :string, index: ["term"]
    field :age, :integer
    field :friends, :uid
    field :location, Dlex.Geo
    field :modified, :datetime
    field :cache, :any, virtual: true
  end
end
now = DateTime.utc_now()
changeset = Ecto.Changeset.cast(%User{}, %{name: "TimeTraveler", age: 20, modified: now},[:name, :age, :modified])
assert {:ok, %{uid: uid}} = TestRepo.set(changeset)

assert {:ok, %User{name: "TimeTraveler", age: 20, modified: now}} = TestRepo.get(uid)
@mangr3n
Copy link
Author

mangr3n commented Jun 18, 2020

#81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant