You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: from_plate_to_tube.rb
    path of file: ./repos/sequencescape/app/models/transfer
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
# Picks the specified wells of a plate into an individual tube.  In this case transfers is an
# array of well locations to transfer into the tube, and the destination is a tube.
class Transfer::FromPlateToTube < Transfer
  include TransfersBySchema
  include TransfersToKnownDestination

  before_validation :default_to_all_wells

  # The values in the transfers must be an array and must be valid well positions on the plate.
  validates_each(:transfers) do |record, _attribute, value|
   
    
  def each_transfer # rubocop:todo Metrics/AbcSize
    # Partition the source plate wells into ones that are good and others that are bad.  The
    # bad wells will be eliminated after we've done the transfers for the good ones.
    source_wells = source.wells.includes(:aliquots, :transfer_requests_as_target)
    bad_wells, good_wells =
      source_wells
        .located_at_position(transfers)
        .with_pool_id
        .partition { |well| well.nil? or well.aliquots.empty? or well.failed? or well.cancelled? }

    good_wells.each { |well| yield(well, destination) }

    # Eliminate any of the transfers that were not made because of the bad source wells
    self.transfers = transfers - bad_wells.map { |well| well.map.description }
  end
end