lib/Rapi/Blog/DB/ResultSet/PreauthActionEvent.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 13 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 65 CC 3 SCAR 12.8
CC
3
Cov
0%
create_with_request
6.0
create_with_hit
6.0
schema
2.0
CRAP 3.6
1 package Rapi::Blog::DB::ResultSet::PreauthActionEvent;
2  
3 use strict;
4 use warnings;
5  
6 use Moo;
7 extends 'DBIx::Class::ResultSet';
8  
9 use RapidApp::Util ':all';
10 use Rapi::Blog::Util;
11  
12 sub schema { (shift)->result_source->schema }
13  
14 sub create_with_request {
15 my ($self, $request, $cr) = @_;
16 $cr ||= {};
17
18 die "->create_with_hit(): hit/id already set!" if ($cr->{hit_id} || $cr->{hit});
19
20 my $Hit = $self->schema->resultset('Hit')->create_from_request({},$request);
21 $self->create_with_hit($Hit,$cr)
22 }
23  
24  
25 sub create_with_hit {
26 my ($self, $Hit, $cr) = @_;
27 $cr ||= {};
28
29 die "->create_with_hit(): hit/id already set!" if ($cr->{hit_id} || $cr->{hit});
30
31 $cr->{hit} = $Hit;
32 $cr->{ts} ||= $Hit->get_column('ts');
33
34 $self->create( $cr )
35 }
36  
37  
38 1;