模块:Mongoid::Association::Reflections::ClassMethods
- 定义于:
- lib/mongoid/association/reflections.rb
实例方法摘要折叠
-
#reflect_on_all_associations (*macros) ⇒ Array<Mongoid::Association::Relatable>
返回所提供宏的所有关联元数据。
-
#reflect_on_association (name) ⇒ Mongoid::Association::Relatable
返回所提供名称的关联元数据。
实例方法详细信息
#reflect_on_all_associations (*macros) ⇒ Array< Mongoid::Association::Relatable >
返回所提供宏的所有关联元数据。
55 56 57 58 59 60 61 62 63 |
# File 'lib/mongoid/association/reflections.rb', line 55 def href_on_all_associations(*宏) all_associations = 关系.values 除非 宏.空? all_associations.选择! do |反射| 宏.包括?(关联::MACRO_MAPPING.key(反射.class)) end end all_associations end |
#reflect_on_association (name) ⇒ Mongoid::Association::Relatable
返回所提供名称的关联元数据。
43 44 45 |
# File 'lib/mongoid/association/reflections.rb', line 43 def href_on_association(名称) 关系[名称.to_s] end |