Class/Module Index [+]

Quicksearch

DataMapper::Associations::OneToMany::Collection

Attributes

relationship[RW]

@api private

source[RW]

@api private

Public Instance Methods

clear() click to toggle source

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

# File lib/dm-core/associations/one_to_many.rb, line 214
def clear
  lazy_load  # lazy load so that targets are always orphaned
  super
end
destroy() click to toggle source

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

# File lib/dm-core/associations/one_to_many.rb, line 256
def destroy
  assert_source_saved 'The source must be saved before mass-deleting the collection'
  super
end
destroy!() click to toggle source

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

# File lib/dm-core/associations/one_to_many.rb, line 271
def destroy!
  assert_source_saved 'The source must be saved before mass-deleting the collection'
  super
end
reload(*) click to toggle source

@api public

# File lib/dm-core/associations/one_to_many.rb, line 187
def reload(*)
  assert_source_saved 'The source must be saved before reloading the collection'
  super
end
replace(*) click to toggle source

Replace the Resources within the 1:m Collection

@param [Enumerable] other

List of other Resources to replace with

@return [Collection]

self

@api public

# File lib/dm-core/associations/one_to_many.rb, line 201
def replace(*)
  lazy_load  # lazy load so that targets are always orphaned
  super
end
update(*) click to toggle source

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

# File lib/dm-core/associations/one_to_many.rb, line 228
def update(*)
  assert_source_saved 'The source must be saved before mass-updating the collection'
  super
end
update!(*) click to toggle source

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

# File lib/dm-core/associations/one_to_many.rb, line 242
def update!(*)
  assert_source_saved 'The source must be saved before mass-updating the collection'
  super
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.