File: ReadOnly.pm

package info (click to toggle)
libdbix-class-perl 0.08010-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,052 kB
  • ctags: 1,064
  • sloc: perl: 10,536; sql: 225; makefile: 45
file content (14 lines) | stat: -rwxr-xr-x 288 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package # hide from PAUSE
    DBIx::Class::CDBICompat::ReadOnly;

use strict;
use warnings;

sub make_read_only {
  my $proto = shift;
  $proto->add_trigger("before_$_" => sub { shift->throw_exception("$proto is read only") })
    foreach qw/create delete update/;
  return $proto;
}

1;