On 10/5/07, Thibaut Barrère <[EMAIL PROTECTED]> wrote:
> Hi,
>
> it seems that when a RowProcessor used as a before_write returns nil, the
> row is removed from the pipeline, but when the same processor is used as an
> after_read, the nil row remains in the pipeline (and the next processor will
> most likely raise a nil exception at soon as it interacts with the row).
>
> The difference seems to lie in engine.rb (process_control):
>
> after_read:                 rows = processed_rows.flatten
> before_write:              rows = processed_rows.flatten.compact
>
> Is there a specific reason for not having compact called as well on
> after_read ?

I assumed that you would want to let your row go through your
transform pipeline before compacting it to remove nils.

> My feeling is that it may be worth DRYing process_control - for the moment I
> didn't analyse further to evaluate the cost and possible side-effects on
> existing installations though...

It is probably worth it, and I have tried to refactor some of it,
however I have not completely refactored it. Ideally I think that the
process_control would basically be a bunch of calls to internal
methods to express each of the processing steps.

V/r
Anthony

-- 
Cell: 321 473-4966
Current Location: Melbourne, FL
_______________________________________________
Activewarehouse-discuss mailing list
Activewarehouse-discuss@rubyforge.org
http://rubyforge.org/mailman/listinfo/activewarehouse-discuss

Reply via email to