Class | DataMapper::Associations::ManyToOne::Relationship |
In: |
lib/dm-core/associations/many_to_one.rb
|
Parent: | Associations::Relationship |
Relationship class with implementation specific to n side of 1 to n association
OPTIONS | = | superclass::OPTIONS.dup << :required << :key |
child_repository_name | -> | source_repository_name |
@api semipublic | ||
child_model | -> | source_model |
@api semipublic | ||
parent_repository_name | -> | target_repository_name |
@api semipublic | ||
parent_model | -> | target_model |
@api semipublic | ||
parent_key | -> | target_key |
@api semipublic |
Returns a set of keys that identify child model
@return [DataMapper::PropertySet] a set of properties that identify child model @api private
Loads and returns association target (ex.: author) for given source resource (ex.: article)
@param source [DataMapper::Resource]
Child object (ex.: instance of article)
@param other_query [DataMapper::Query]
Query options
@api semipublic
Loads association target and sets resulting value on given source resource
@param [Resource] source
the source resource for the association
@return [undefined]
@api private
Sets value of association target (ex.: author) for given source resource (ex.: article)
@param source [DataMapper::Resource]
Child object (ex.: instance of article)
@param source [DataMapper::Resource]
Parent object (ex.: instance of author)
@api semipublic
Returns a hash of conditions that scopes query that fetches target object
@return [Hash]
Hash of conditions that scopes query
@api private