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
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
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
@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 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 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 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
Generated with the Darkfish Rdoc Generator 2.