1
我正在使用Phoenix Framework将使用Rails编写的API重写为Elixir。如何使用Ecto读取/写入Rails ActiveRecord datetime字段?
主要网站使用Rails,并将继续使用Rails。不过,我希望API使用Elixir。
我需要能够从我的Elixir API项目中读取created_at
字段。
defmodule Example.Recipe do
use Ecto.Schema
schema "recipes" do
field :name, :string
field :description, :string
field :slug, :string
field :created_at ???datetime?
end
end
如何从我的药剂API正确读取created_at
和updated_at
领域?
我知道Ecto使用Ecto.DateTime
但是兼容?