File Coverage

blib/lib/Catalyst/Model/CDBI/Sweet.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Catalyst::Model::CDBI::Sweet;
2              
3 1     1   889 use strict;
  1         2  
  1         39  
4 1     1   5 use base qw[Class::DBI::Sweet Catalyst::Base];
  1         2  
  1         1132  
5              
6             use Catalyst::Exception;
7              
8             our $VERSION = '0.06';
9              
10             *new = Catalyst::Base->can('new');
11              
12             sub _croak {
13             my ( $self, $message ) = @_;
14            
15             local $Carp::CarpLevel = 2;
16            
17             Catalyst::Exception->throw( message => $message );
18             }
19              
20             1;
21              
22             __END__
23              
24             =head1 NAME
25              
26             Catalyst::Model::CDBI::Sweet - Making sweet things sweeter
27              
28             =head1 SYNOPSIS
29              
30             package MyApp::Model::CDBI;
31             use base 'Catalyst::Model::CDBI::Sweet';
32             MyApp::Model::CDBI->connection('DBI:driver:database');
33            
34             package MyApp::Model::Article;
35             use base 'MyApp::Model::CDBI';
36            
37             ... # table class config here
38              
39             =head1 DESCRIPTION
40              
41             This model is a thin wrapper around L<Class::DBI::Sweet> to let you use it
42             as a Catalyst Model easily. It's similar to L<Catalyst::Model::CDBI::Plain>.
43              
44             If you want to use loader, you will probably want to add something like this
45             to your CDBI model config section instead:
46              
47             left_base_classes => qw/Class::DBI::Sweet/,
48              
49             To see how you can take advantage of this module, please check out the
50             L<Class::DBI::Sweet> documentation.
51              
52             =head1 SEE ALSO
53              
54             L<Class::DBI::Sweet>, L<Catalyst::Model::CDBI>, L<Catalyst>.
55              
56             =head1 AUTHOR
57              
58             Christian Hansen <ch@ngmedia.com>
59              
60             =head1 THANKS TO
61              
62             Danijel Milicevic, Jesse Sheidlower, Marcus Ramberg, Sebastian Riedel,
63             Viljo Marrandi
64              
65             =head1 SUPPORT
66              
67             #catalyst on L<irc://irc.perl.org>
68              
69             L<http://lists.rawmode.org/mailman/listinfo/catalyst>
70              
71             L<http://lists.rawmode.org/mailman/listinfo/catalyst-dev>
72              
73             =head1 LICENSE
74              
75             This library is free software; you can redistribute it and/or modify
76             it under the same terms as Perl itself.
77              
78             =head1 SEE ALSO
79              
80             L<Catalyst>
81              
82             L<Class::DBI::Sweet>
83              
84             =cut