Class: DataMapper::Associations::OneToMany::Relationship

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

### Methods

child_key collection_for get new set target_key

### External Aliases

child_repository_name | -> | target_repository_name
| TODO: document @api semipublic
child_model | -> | target_model
| TODO: document @api semipublic
parent_repository_name | -> | source_repository_name
| TODO: document @api semipublic
parent_model | -> | source_model
| TODO: document @api semipublic
parent_key | -> | source_key
| TODO: document @api semipublic

### Public Class methods

new(name, target_model, source_model, options = {})

TODO: document @api semipublic

### Public Instance methods

child_key()

TODO: document @api semipublic

collection_for(source, other_query = nil)

Returns a Collection for this relationship with a given source

@param [Resource] source

      A Resource to scope the collection with

@param [Query] other_query (optional)

      A Query to further scope the collection with

@return [Collection]

      The collection scoped to the relationship, source and query

@api private

get(source, other_query = nil)

Loads and returns association targets (ex.: articles) for given source resource (ex.: author)

@api semipublic

set(source, targets)

Sets value of association targets (ex.: paragraphs) for given source resource (ex.: article)

@api semipublic

target_key()

Alias for child_key

[Validate]