模块: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 >
返回所提供宏的所有关联元数据。
58 59 60 61 62 63 64 65 66 |
# File 'lib/mongoid/association/reflections.rb', line 58 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
返回所提供名称的关联元数据。
46 47 48 |
# File 'lib/mongoid/association/reflections.rb', line 46 def href_on_association(名称) 关系[名称.to_s] end |