File Coverage

blib/lib/CatalystX/OAuth2/Schema/Result/Client.pm
Criterion Covered Total %
statement 3 4 75.0
branch n/a
condition n/a
subroutine 1 2 50.0
pod 0 1 0.0
total 4 7 57.1


line stmt bran cond sub pod time code
1             package CatalystX::OAuth2::Schema::Result::Client;
2 8     8   21467 use parent 'DBIx::Class';
  8         24  
  8         68  
3              
4             # ABSTRACT: A table for registering clients
5              
6             __PACKAGE__->load_components(qw(Core));
7             __PACKAGE__->table('client');
8             __PACKAGE__->add_columns(
9             id => { data_type => 'int', is_auto_increment => 1 },
10             endpoint => { data_type => 'text', is_nullable => 0 },
11             client_secret => { data_type => 'text', is_nullable => 1 }
12             );
13             __PACKAGE__->set_primary_key('id');
14             __PACKAGE__->has_many( codes => 'CatalystX::OAuth2::Schema::Result::Code' =>
15             { 'foreign.client_id' => 'self.id' } );
16              
17             sub find_refresh {
18 0     0 0   shift->codes->search( { is_active => 1 } )
19             ->related_resultset('refresh_tokens')->find(@_);
20             }
21              
22             1;
23              
24             __END__
25              
26             =pod
27              
28             =head1 NAME
29              
30             CatalystX::OAuth2::Schema::Result::Client - A table for registering clients
31              
32             =head1 VERSION
33              
34             version 0.001007
35              
36             =head1 AUTHOR
37              
38             Eden Cardim <edencardim@gmail.com>
39              
40             =head1 COPYRIGHT AND LICENSE
41              
42             This software is copyright (c) 2017 by Suretec Systems Ltd.
43              
44             This is free software; you can redistribute it and/or modify it under
45             the same terms as the Perl 5 programming language system itself.
46              
47             =cut