模块:Mongoid::Association::Embedded::EmbeddedIn::Buildable
- 定义于:
- lib/mongoid/association/embedded/embedded_in/buildable.rb
Overview
embedded_in 关联的构建器行为。
实例方法摘要折叠
-
#构建(_base, 对象, _type = nil, Selected_fields = nil) ⇒ Document
该构建器实际上并不构建任何内容,只是返回父构建器,因为它应该已经被实例化。
实例方法详细信息
#构建(_base, object, _type = nil, selected_fields = nil) ⇒ Document
该构建器实际上并不构建任何内容,只是返回父构建器,因为它应该已经被实例化。
25 26 27 28 29 30 31 32 33 |
# File 'lib/mongoid/association/embedded/embedded_in/buildable.rb', line 25 def 构建(_base, 对象, _type = nil, created_fields = nil) return 对象 除非 对象.is_a?(哈希) if _loading? 工厂.from_db(klass, 对象, nil, created_fields) else 工厂.构建(klass, 对象) end end |