## On create/insert, add new entry to AuditLog
-# sub new
-# {
-# my ($class, $attrs, @rest) = @_;
-
-# $class->result_source->schema->_journal_schema->current_user(delete $attrs->{user_id});
-
-# $class->next::method($attrs, @rest);
-# }
-
sub _journal_schema {
my $self = shift;
$self->result_source->schema->_journal_schema;
## On update, copy previous row's contents to AuditHistory
-sub update
+sub update
{
my ($self, $upd, @rest) = @_;
$self->journal_log_update($upd, @rest);
$self->next::method($upd, @rest);
}
-sub journal_log_update
+sub journal_log_update
{
my ($self, $upd, @rest) = @_;
=head2 TABLES
-The journal schema contains a number of tables.
+The journal schema contains a number of tables.
=over
use strict;
use warnings;
-# sub throw_exception
-# {
-# }
-
-# sub exception_action
-# {
-# my $self = shift;
-# # print STDERR Carp::longmess;
-
-# $self->next::method(@_);
-# }
-
-# sub load_classes
-# {
-# my $class = shift;
-
-
-# $class->next::method(@_);
-
-# }
sub _journal_schema_prototype
{
next unless($j_sources{$s_name});
$self->create_journal_for($s_name => $proto);
$self->class($s_name)->load_components($comp);
-# print STDERR "$s_name :", $self->class($s_name), "\n";
}
return $proto;
}
my $self = shift;
my $schema = $self->next::method(@_);
-# print STDERR join(":", $self->sources), "\n";
-
my $journal_schema = (ref $self||$self)->_journal_schema_prototype->clone;
if($self->journal_connection)