Class DataMapper::Associations::ManyToMany::Relationship
In: lib/dm-core/associations/many_to_many.rb
Parent: Associations::OneToMany::Relationship

Methods

child_key   eager_load   finalize   links   query   source_scope   target_key   through   via  

Constants

OPTIONS = superclass::OPTIONS.dup << :through << :via

Public Instance methods

Returns a set of keys that identify the target model

@return [DataMapper::PropertySet]

  a set of properties that identify the target model

@api semipublic

Eager load the collection using the source as a base

@param [Resource, Collection] source

  the source to query with

@param [Query, Hash] other_query

  optional query to restrict the collection

@return [ManyToMany::Collection]

  the loaded collection for the source

@api private

Initialize the chain for "many to many" relationships

@api public

@api semipublic

@api private

target_key()

Alias for child_key

Intermediate association for through model relationships

Example: for :bugs association in

class Software::Engineer

  include DataMapper::Resource

  has n, :missing_tests
  has n, :bugs, :through => :missing_tests

end

through is :missing_tests

TODO: document a case when through option is a model and not an association name

@api semipublic

@api semipublic

[Validate]