Class: DataMapper::Associations::OneToMany::Collection

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

### Methods

clear destroy destroy! reload replace update update!

### Attributes

relationship | [RW] | TODO: document @api private
source | [RW] | TODO: document @api private

### Public Instance methods

clear()

Removes all Resources from the 1:m Collection

This should remove and orphan each Resource from the 1:m Collection.

@return [Collection]

      self

@api public

destroy()

Remove every Resource in the 1:m Collection from the repository

This performs a deletion of each Resource in the Collection from the repository and clears the Collection.

@return [Boolean]

      true if the resources were successfully destroyed

@api public

destroy!()

Remove every Resource in the 1:m Collection from the repository, bypassing validation

This performs a deletion of each Resource in the Collection from the repository and clears the Collection while skipping validation.

@return [Boolean]

      true if the resources were successfully destroyed

@api public

reload(*)

TODO: document @api public

replace(*)

Replace the Resources within the 1:m Collection

@param [Enumerable] other

      List of other Resources to replace with

@return [Collection]

      self

@api public

update(*)

Update every Resource in the 1:m Collection

@param [Hash] attributes

      attributes to update with

@return [Boolean]

      true if the resources were successfully updated

@api public

update!(*)

Update every Resource in the 1:m Collection, bypassing validation

@param [Hash] attributes

      attributes to update

@return [Boolean]

      true if the resources were successfully updated

@api public

[Validate]