File Coverage

blib/lib/Pinto/Schema/ResultSet/Distribution.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition 1 2 50.0
subroutine 6 6 100.0
pod 0 2 0.0
total 25 28 89.2


line stmt bran cond sub pod time code
1             # ABSTRACT: Common queries for Distributions
2              
3 54     54   62971 use utf8;
  54         138  
  54         391  
4              
5             package Pinto::Schema::ResultSet::Distribution;
6              
7 54     54   2219 use strict;
  54         133  
  54         1168  
8 54     54   270 use warnings;
  54         125  
  54         1527  
9              
10 54     54   275 use base 'DBIx::Class::ResultSet';
  54         108  
  54         10140  
11              
12             #------------------------------------------------------------------------------
13              
14             our $VERSION = '0.14'; # VERSION
15              
16             #------------------------------------------------------------------------------
17              
18             sub with_packages {
19 309     309 0 114845 my ( $self, $where ) = @_;
20              
21 309   50     3285 return $self->search( $where || {}, { prefetch => 'packages' } );
22             }
23              
24             #------------------------------------------------------------------------------
25              
26             sub find_by_author_archive {
27 227     227 0 769 my ( $self, $author, $archive ) = @_;
28              
29 227         950 my $where = { author => $author, archive => $archive };
30 227         1073 my $attrs = { key => 'author_archive_unique' };
31              
32 227         1351 return $self->find( $where, $attrs );
33             }
34              
35             #------------------------------------------------------------------------------
36             1;
37              
38             __END__
39              
40             =pod
41              
42             =encoding UTF-8
43              
44             =for :stopwords Jeffrey Ryan Thalhammer
45              
46             =head1 NAME
47              
48             Pinto::Schema::ResultSet::Distribution - Common queries for Distributions
49              
50             =head1 VERSION
51              
52             version 0.14
53              
54             =head1 AUTHOR
55              
56             Jeffrey Ryan Thalhammer <jeff@stratopan.com>
57              
58             =head1 COPYRIGHT AND LICENSE
59              
60             This software is copyright (c) 2015 by Jeffrey Ryan Thalhammer.
61              
62             This is free software; you can redistribute it and/or modify it under
63             the same terms as the Perl 5 programming language system itself.
64              
65             =cut