Class: Og::ManyToMany

Inherits:
JoinsMany show all
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

#options

Instance Method Summary collapse

Methods inherited from JoinsMany

#enchant

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_polymorphicObject

– 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