Given a table "article" which has_many "article_history" would this be a reasonable approach to keeping track of the history for diffs and stuff? Is there a better one? Just store the diff (and apply them recursively to roll-back versions)? Is anyone else already doing this; share your code?

sub (in article) store_column {
    my ( $self, $name, $value ) = @_;
    if ( $name eq "body" ) {
        $self->add_to_article_history
            ({ body => $value,
               created => \'NOW', #'
           });
    }
    $self->next::method($name, $value);
}



–Ashley
--




_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to