Ok, so your code assume that the aliquot passed in each is passed by reference and that the array returned by the each block
has been modified (by side effect)  before being returned.

I agree it works, but I personally don't like it. It has side-effect and therefore, is hard to read the real intention of the code (you never know if a side-effect is desired or not),

Max


On Jan 11, 2013, at 9:31 AM, llh1 <notifications@github.com> wrote:

> In lib/lims-core/actions/plate_transfer.rb:
> 
> >        def _call_in_session(session)
> >            transfer_map.each do |from ,to|
> > -            target[to] << source[from].take
> > +            target[to] << source[from].take.each do |aliquot|
> If a block is passed to each, each returns the array calling each, if no block is passed, each returns an enumerator.
> 
> —
> Reply to this email directly or view it on GitHub.
> 
>