handle the throw_exception bit. Drop DBIx::Class::Exception
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / ReadOnly.pm
1 package DBIx::Class::CDBICompat::ReadOnly;
2
3 use strict;
4 use warnings;
5
6 sub make_read_only {
7   my $proto = shift;
8   $proto->add_trigger("before_$_" => sub { shift->throw_exception("$proto is read only") })
9     foreach qw/create delete update/;
10   return $proto;
11 }
12
13 1;