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; |
8 | $proto->add_trigger("before_$_" => sub { shift->throw("$proto is read only") }) |
9 | foreach qw/create delete update/; |
10 | return $proto; |
11 | } |
12 | |
13 | 1; |