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