Class: DataMapper::Associations::ManyToMany::Relationship

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

### Methods

child_key eager_load links query source_scope target_key through via

### Constants

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

### Public Instance methods

child_key()

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(source, other_query = nil)

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

links()

TODO: document @api semipublic

query()

TODO: document @api private

source_scope(source)

TODO: document @api private

target_key()

Alias for child_key

through()

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

via()

TODO: document @api semipublic

[Validate]