类:Mongoid::Association::Embedded::EmbeddedIn
- 继承:
-
对象
- 对象
- Mongoid::Association::Embedded::EmbeddedIn
- 定义于:
- lib/mongoid/association/embedded/embedded_in.rb ,
lib/mongoid/association/embedded/embedded_in/proxy.rb,
lib/mongoid/association/embedded/embedded_in/bounding.rb,
lib/mongoid/association/embedded/embedded_in/buildable.rb
Overview
EmbeddedIn 类型关联。
在命名空间下定义
常量摘要折叠
- ASSOCIATION_OPTIONS =
除常用选项外,还可用于此类关联的选项。
[ :autobuild, :循环, :poly态, :touch, ].冻结
- VALID_OPTIONS =
此关联的有效选项的完整列表,包括共享选项。
(ASSOCIATION_OPTIONS + SHARED_OPTIONS).冻结
Relatable 中包含的常量
Relatable::PRIMARY_KEY_DEFAULT 、 Relatable::SHARED_OPTIONS
实例属性摘要
Relatable 中包含的属性
#name 、 #options 、 #parent_inclusions
实例方法摘要折叠
-
# embedded? ⇒ true
此关联类型是否为嵌入式?
-
#键⇒ string
用于获取关联对象属性的键。
-
#nested_builder (attributes, options) ⇒ Association::Nested::One
嵌套构建器对象。
-
#多态? ⇒ true | false
此关联是否具有多态性?
-
#primary_key ⇒ nil
主键。
-
#关系⇒ Association::Embedded::EmbeddedIn::Proxy
获取此关联类型的关联代理类。
-
# 设置! ⇒ self
设置实例方法、字段等。
-
#stores_foreign_key? ⇒ false
此关联类型是否存储外键?
-
#validation_default ⇒ false
用于验证关联对象的默认。
Buildable中包含的方法
Relatable 中包含的方法
#==, #bindable?, #counter_cache_column_name, #create_relation, #destructive?, #extension, #foreign_key_check, #foreign_key_setter, #get_callbacks, #in_to?, #initialize, #inverse, #inverse_association, #inverse_class, #inverse_class_name, #inverse_setter, #inverse_type, #inverse_type_setter, #inverses, #many?, #one?, #path, #relation_class, #relation_class_name, #setter, #type_setter, #validate?
选项中包含的方法
#as , #autoBuilding? 、 #autosave 、 #cascading_callbacks? , #counter_cached? , #cycle? 、#depend、# forced_nil_inverse ? , #indexed? 、#inverse_of、# order、#store_as 、 # touch_field 、 # touchable? , #type
Constrainable中包含的方法
实例方法详细信息
# embedded? ⇒ true
此关联类型是否为嵌入式?
47 |
# File 'lib/mongoid/association/embedded/embedded_in.rb', line 47 def ; true; end |
#键⇒ string
用于获取关联对象属性的键。
67 68 69 |
# File 'lib/mongoid/association/embedded/embedded_in.rb', line 67 def key @key ||= 名称.to_s end |
#nested_builder (attributes, options) ⇒ Association::Nested::One
嵌套构建器对象。
91 92 93 |
# File 'lib/mongoid/association/embedded/embedded_in.rb', line 91 def nested_builder(属性, ) 嵌套::one.new(self, 属性, ) end |
#多态? ⇒ true | false
此关联是否具有多态性?
81 82 83 |
# File 'lib/mongoid/association/embedded/embedded_in.rb', line 81 def 多态? !!@options[:poly态] end |
#primary_key ⇒ nil
主键
52 |
# File 'lib/mongoid/association/embedded/embedded_in.rb', line 52 def primary_key; end |
#关系⇒ Association::Embedded::EmbeddedIn::Proxy
获取此关联类型的关联代理类。
74 75 76 |
# File 'lib/mongoid/association/embedded/embedded_in.rb', line 74 def 关系 代理 end |
# setup! ⇒ self
在关联所属类上设置实例方法、字段等。
37 38 39 40 41 42 |
# File 'lib/mongoid/association/embedded/embedded_in.rb', line 37 def setup! setup_defaults! setup_instance_methods! @owner_class. = true self end |
#stores_foreign_key? ⇒ false
此关联类型是否存储外键?
57 |
# File 'lib/mongoid/association/embedded/embedded_in.rb', line 57 def store_foreign_key?; false; end |
# validation_default ⇒ false
用于验证关联对象的默认。
62 |
# File 'lib/mongoid/association/embedded/embedded_in.rb', line 62 def validation_default; false; end |