| 1 | package DBIx::Class::Valiant::Validates; | ||
| 2 | |||
| 3 | 7 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 7 | ▶ | use Valiant::I18N; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 7 | ▶ | use Scalar::Util; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 7 | with 'Valiant::Validates'; | |
| 8 | |||
| 9 | around default_validator_namespaces => sub { | ||
| 10 | 297 | ▶ | my ($orig, $self, @args) = @_; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 11 | 297 | return 'DBIx::Class::Valiant::Validator', $self->$orig(@args); | |
| 12 | 7 | }; | |
| 13 | |||
| 14 | 7 | 1; | |
| 15 | |||
| 16 | =head1 NAME | ||
| 17 | |||
| 18 | DBIx::Class::Valiant::Validates - Add Valiant to DBIC | ||
| 19 | |||
| 20 | =head1 DESCRIPTION | ||
| 21 | |||
| 22 | This is a role which extends L<Valiant::Validates> so that is finds validators | ||
| 23 | under the L<DBIx::Class::Valiant::Validator> namespace. It adds this namespace | ||
| 24 | to the top of the call list, that way we can if needed override core validators | ||
| 25 | with versions that work properly under L<DBIx::Class>. | ||
| 26 | |||
| 27 | You shouldn't need to use this code directly yourself, it gets added automatically | ||
| 28 | for you. | ||
| 29 | |||
| 30 | =head1 SEE ALSO | ||
| 31 | |||
| 32 | See L<Valiant>, L<DBIx::Class::Valiant> | ||
| 33 | |||
| 34 | =head1 AUTHOR | ||
| 35 | |||
| 36 | See L<Valiant>. | ||
| 37 | |||
| 38 | =head1 COPYRIGHT & LICENSE | ||
| 39 | |||
| 40 | See L<Valiant>. | ||
| 41 | |||
| 42 | =cut | ||