use warnings;
our $VERSION = '0.900001_02';
+$VERSION = eval $VERSION; # no errors in dev versions
## On create/insert, add new entry to AuditLog
=head1 SYNOPSIS
- package My::Schema;
- use base 'DBIx::Class::Schema';
+ package My::Schema;
+ use base 'DBIx::Class::Schema';
- __PACKAGE__->load_components(qw/+DBIx::Class::Schema::Journal/);
+ __PACKAGE__->load_components(qw/Schema::Journal/);
- __PACKAGE__->journal_connection(['dbi:SQLite:t/var/Audit.db']);
- __PACKAGE__->journal_user(['My::Schema::User', {'foreign.userid' => 'self.user_id'}]);
+ __PACKAGE__->journal_connection(['dbi:SQLite:t/var/Audit.db']);
+ __PACKAGE__->journal_user(['My::Schema::User', {'foreign.userid' => 'self.user_id'}]);
- ########
+ #######
- $schema->changeset_user($user->id);
- my $new_artist = $schema->txn_do( sub {
- return = $schema->resultset('Artist')->create({ name => 'Fred' });
- });
+ $schema->changeset_user($user->id);
+ my $new_artist = $schema->txn_do( sub {
+ return $schema->resultset('Artist')->create({ name => 'Fred' });
+ });
=head1 DESCRIPTION
of each row is stored, as well as the previous contents of any row
that gets changed.
-All queries which want auditing should be called using
+All queries which need auditing must be called using
L<DBIx::Class::Schema/txn_do>, which is used to create changesets for
each transaction.