Commit | Line | Data |
---|---|---|
a1373054 | 1 | package DBIx::Class::CDBICompat::ReadOnly; |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | sub make_read_only { | |
7 | my $proto = shift; | |
701da8c4 | 8 | $proto->add_trigger("before_$_" => sub { shift->throw_exception("$proto is read only") }) |
a1373054 | 9 | foreach qw/create delete update/; |
10 | return $proto; | |
11 | } | |
12 | ||
13 | 1; |