Schema中的默认值

时间:2018-04-26 13:16:18

标签: elixir phoenix-framework ecto

所以我有my_perfect_random函数返回string

的值
schema "something_greate" do
  field :my_amazing_field, :string, default: my_perfect_random
  timestamps()
end

错误是

undefined my_perfect_random/0

该功能写在同一个模块中。我尝试使用MyModule.my_perfect_random,但收到同样的错误

请帮我解决问题

0 个答案:

没有答案