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