[jifty-devel] Handling register_triggers with mixins on virtual models

Andrew Sterling Hanenkamp sterling at hanenkamp.com
Wed Aug 22 18:09:08 EDT 2007

On 8/22/07, Jesse Vincent <jesse at bestpractical.com> wrote:
> >    1. Trunk change: Add two new "pseudo-triggers" before_any_set and
> >    after_any_set. Setting a before_any_set trigger would cause a
> >    before_set_X trigger to be set for every column on the table. The
> >    after_any_set trigger would do the same for after_set_X. The
> >    virtual models branch would then add these triggers to any new column as
> >    they are created as well.
> >
> > I know I like #2.
> >
> > after_set and before_set feel more natural than after_any_...
> >
> I am not sure where the best place is to implement this one. It seems like
> it should be an override of add_trigger() in Jifty::DBI::Record, but since
> add_trigger() is directly imported into Jifty::DBI::Record from
> Jifty::DBI::Class::Trigger, that's a bit messy. I can do the messy solution,
> but if there's a better way, I'd rather do that instead if someone has a
> suggestion.
> Why not just add another trigger to Jifty::DBI::Record? oh. also now
> Jifty::DBI can use the released Class::Trigger. 0.12 has all the features
> we added to the forked version.

As in just add an additional call to call_trigger() for before_set and
after_set to _set? I'm generally hesitant to making a change that could have
such global affects for performance. If you don't think that's a problem, I
don't have a problem with it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20070822/da575705/attachment.htm

More information about the jifty-devel mailing list