新手问题 mongoid (5.2.1) 关于 autobuild 的问题

Awlter1 · September 06, 2018 · 895 hits
Class Apple
  embeds_one :core, autobuild: true
end

Class Core
  field :seed_type, type: String, default: -> { binding.pry; apple }
end
apple = Apple.new

apple.core

请问 apple 为什么是 nil 呢

Awlter1 closed this topic. 06 Sep 20:07
Awlter1 reopened this topic. 06 Sep 20:08
You need to Sign in before reply, if you don't have an account, please Sign up first.