sanger/lims-laboratory-app — pull request #21 by llh1 (2013-06-11 13:23:52+00:00)
Title: 51473129 fix create tube with non existing sample uuids

When we create a tube with more than one sample, providing only sample uuids for sample which do NOT already exist in the system and identical aliquot quantity and type, the tube is not correctly created. Only one aliquot is saved, with its quantity sets at the sum of all the other aliquot quantities. It's because in the laboratory/receptacle.rb#<< method.

Actually, when we pass a sample uuid, and that sample do not exist in the system, the sample doesn't have a name. When we call to_s on the sample contained in an aliquot, it returns nil in that case (as to_s on a sample returns its name). In laboratory/receptacle.rb#<<, the comparison === returns true and all the aliquot are added to the first one.

To fix that, when we create aliquot based on sample uuids which do not exist in the system, we add a name "Sample ".