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