类:Mongoid::Association::Embedded::EmbedsMany::Binding
- 继承:
-
对象
- 对象
- Mongoid::Association::Embedded::EmbedsMany::Binding
- 包括:
- Bindable
- 定义于:
- lib/mongoid/association/embedded/embeds_many/ Binding.rb
Overview
所有 embeds_many 关联的绑定类。
实例属性摘要
Bindable中包含的属性
#_association 、 #_base 、 #_target
实例方法摘要折叠
-
# bind_one (doc) ⇒ 对象
使用反向关联绑定单个文档。
-
# unbind_one (doc) ⇒ 对象
取消绑定单个文档。
Bindable中包含的方法
实例方法详细信息
# bind_one (doc) ⇒对象
使用反向关联绑定单个文档。 专门在附加到代理时使用。
20 21 22 23 24 25 26 |
# File 'lib/mongoid/association/embedded/embeds_many/ Binding.rb', line 20 def bind_one(doc) doc.将(_base) 绑定 do remove_关联(doc) try_method(doc, _association.inverse_setter(_target), _base) end end |
#unbind_one(doc) ⇒ Object
取消绑定单个文档。
34 35 36 37 38 |
# File 'lib/mongoid/association/embedded/embeds_many/ Binding.rb', line 34 def unbind_one(doc) 绑定 do try_method(doc, _association.inverse_setter(_target), nil) end end |