- Overview
I have a bunch of classes that represent email filters, and are backed by a legacy database. The interface to the legacy database is through DBIx::Class. A filter is essentially two things: a condition and an action. An email message is passed to the condition object, which reports whether the condition is satisfied; if so, the message is passed to the action object, which performs some action, possibly modifying the message. The legacy database principally involves two tables: mh_conds, representing conditions, and mh_actions, representing actions.
I have code that examines the tables using DBIx::Class and constructs Filter objects, and also code for the reverse direction: you can manufacture a Filter object, including its subsidiary Condition and Action objects, and then store it into the database.
The storage code is peculiar. The way it works is that Condition and Action objects each have an as_rows method, which returns a list of DBIx::Class::Row objects. To i