Class: Og::ManyToMany
- Defined in:
- lib/og/relation/many_to_many.rb
Overview
A ‘many_to_many’ relation. This objects is associated with an other using an intermediate join table. Just an alias for ‘joins_many’.
Examples
many_to_many Category many_to_many :categories, Category
Instance Attribute Summary
Attributes inherited from Relation
Instance Method Summary collapse
-
#resolve_polymorphic ⇒ Object
– FIXME: better enchant polymorphic parents and then add an alias to :objects.
Methods inherited from JoinsMany
Methods inherited from Relation
#[], #[]=, enchant, #enchant, #initialize, #method_missing, #polymorphic?, #polymorphic_marker?, resolve, resolve_names, resolve_polymorphic_markers, resolve_polymorphic_relations, resolve_targets, symbol_to_class, #to_s
Constructor Details
This class inherits a constructor from Og::Relation
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Og::Relation
Instance Method Details
#resolve_polymorphic ⇒ Object
– FIXME: better enchant polymorphic parents and then add an alias to :objects. ++
20 21 22 23 24 |
# File 'lib/og/relation/many_to_many.rb', line 20 def resolve_polymorphic target_class.module_eval %{ many_to_many :#{owner_class.to_s.demodulize.underscore.pluralize} } end |