lib/scaffolding_extensions/meta_model.rb
# Removes associated objects with the given ids from the given object's association.
# Returns the associated object (if only one id was given), or an array of objects
# (if multiple ids were given).
Removes associated objects with the given ids from the given object's association.
Returns the associated object (if only one id was given), or an array of objects
(if multiple ids were given).
Removes associated objects with the given ids from the given object ' s association . Returns the associated object ( if only one id was given ) or an array of objects ( if multiple ids were given ) .
def scaffold_remove_associated_objects(association, object, options, *associated_object_ids)
    unless associated_object_ids.empty?
      scaffold_transaction do
        associated_objects = associated_object_ids.collect do |associated_object_id|
          associated_object = scaffold_association_find_object(association, associated_object_id.to_i, :session=>options[:session])
          scaffold_remove_associated_object(association, object, associated_object)
          associated_object
        end
        associated_object_ids.length == 1 ? associated_objects.first : associated_objects
      end
    end
  end
def scaffold_remove_associated_objects ( association , object , options , * associated_object_ids ) unless associated_object_ids . empty? scaffold_transaction do associated_objects = associated_object_ids . collect do | associated_object_id | associated_object = scaffold_association_find_object ( association , associated_object_id . to_i , :session => options [ :session ] ) scaffold_remove_associated_object ( association , object , associated_object ) associated_object end associated_object_ids . length == 1 ? associated_objects . first : associated_objects end end end
Removes associated objects with the given ids from the given object's association.
Removes associated objects with the given ids from the given object ' s association .
association
<not_specific>
object
<not_specific>
options
<not_specific>
associated_object_ids
<not_specific>