RoutesAuthDBI/Model/Routes.pm untested

filter: Statementstmt 0.0% 0 / 14 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 35 CC 6 SCAR 17.3
CC
6
Cov
0%
routes
6.0
routes_ref
6.0
routes_action
6.0
CRAP 5.6
1 package Mojolicious::Plugin::RoutesAuthDBI::Model::Routes;
2 #~ use Mojo::Base 'DBIx::Mojo::Model';
3 use Mojo::Base 'Mojolicious::Plugin::RoutesAuthDBI::Model::Base';
4  
5 #~ sub new {
6 #~ state $self = shift->SUPER::new(@_);
7 #~ }
8  
9 sub routes {
10 my $self = ref($_[0]) ? shift : shift->new;
11
12 $self->dbh->selectall_arrayref($self->sth('apply routes'), { Slice => {} },);
13 }
14  
15 sub routes_ref {
16 my $self = ref($_[0]) ? shift : shift->new;
17 $self->dbh->selectall_arrayref($self->sth('role routes'), { Slice => {} }, (shift));
18 }
19  
20 sub routes_action {# маршруты действия
21 my $self = ref($_[0]) ? shift : shift->new;
22 $self->dbh->selectall_arrayref($self->sth('action routes', where=>"where action_id=?"), { Slice => {} }, (shift));
23 }
24  
25 sub routes_action_null {# маршруты без действия
26 my $self = ref($_[0]) ? shift : shift->new;
27 $self->dbh->selectall_arrayref($self->sth('action routes', where=>"where action_id is null"), { Slice => {} });
28 }
29  
30 sub new_route {
31 my $self = ref($_[0]) ? shift : shift->new;
32 $self->dbh->selectrow_hashref($self->sth('new route'), undef, (@_));
33 }
34  
35 1;
36  
37 __DATA__