-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Labels
Description
Hello, I am trying to integrate ex_audit wit my application using more or less the default configuration.
However when I try to save a model with changes I get the following error:
:utc_datetime expects microseconds to be empty, got: #DateTime<2019-05-02 05:19:39.935000Z>
Use `DateTime.truncate(utc_datetime, :second)` (available in Elixir v1.6+) to remove microseconds.
lib/ecto/type.ex
end
defp check_no_usec!(%{microsecond: {0, 0}} = datetime, _kind), do: datetime
defp check_no_usec!(%struct{} = datetime, kind) do
raise ArgumentError, """
#{inspect(kind)} expects microseconds to be empty, got: #{inspect(datetime)}
Use `#{inspect(struct)}.truncate(#{kind}, :second)` (available in Elixir v1.6+) to remove microseconds.
"""
end
Any suggestions on how to fix ?
Here are the versions I use:
...
ecto 3.1.1
ecto_sql 3.1.1
ex_audit 0.6.0
phoenix 1.4.3
phoenix_ecto 4.0.0
Also here's the whole ST:
ecto lib/ecto/type.ex:1224 Ecto.Type.check_no_usec!/2
ecto lib/ecto/type.ex:412 Ecto.Type.dump_utc_datetime/1
ecto lib/ecto/type.ex:817 Ecto.Type.process_dumpers/3
ecto lib/ecto/repo/schema.ex:925 Ecto.Repo.Schema.dump_field!/6
ecto lib/ecto/repo/schema.ex:109 anonymous fn/5 in Ecto.Repo.Schema.init_mapper/3
elixir lib/enum.ex:1437 anonymous fn/3 in Enum.map_reduce/3
stdlib maps.erl:257 :maps.fold_1/3
elixir lib/enum.ex:1956 Enum.map_reduce/3
ecto lib/ecto/repo/schema.ex:81 anonymous fn/5 in Ecto.Repo.Schema.extract_header_and_fields/5
elixir lib/enum.ex:1431 Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
ecto lib/ecto/repo/schema.ex:80 Ecto.Repo.Schema.extract_header_and_fields/5
ecto lib/ecto/repo/schema.ex:44 Ecto.Repo.Schema.do_insert_all/6
ex_audit lib/repo/schema.ex:34 anonymous fn/4 in ExAudit.Schema.update/4
ex_audit lib/repo/schema.ex:155 ExAudit.Schema.run_in_multi/4
ecto lib/ecto/multi.ex:579 Ecto.Multi.apply_operation/5
elixir lib/enum.ex:1940 Enum."-reduce/3-lists^foldl/2-0-"/3
ecto lib/ecto/multi.ex:563 anonymous fn/5 in Ecto.Multi.apply_operations/5
ecto_sql lib/ecto/adapters/sql.ex:874 anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4
db_connection lib/db_connection.ex:1415 DBConnection.run_transaction/4
ecto lib/ecto/repo/transaction.ex:15 Ecto.Repo.Transaction.transaction/4
Thanks !
Reactions are currently unavailable