[Bast-commits] r3523 - in trunk/DBIx-Class-Validation: .
lib/DBIx/Class
claco at dev.catalyst.perl.org
claco at dev.catalyst.perl.org
Mon Jun 25 02:14:01 GMT 2007
Author: claco
Date: 2007-06-25 02:14:00 +0100 (Mon, 25 Jun 2007)
New Revision: 3523
Modified:
trunk/DBIx-Class-Validation/Changes
trunk/DBIx-Class-Validation/README
trunk/DBIx-Class-Validation/lib/DBIx/Class/Validation.pm
Log:
Converted to Class::Accessor::Grouped after mk_classdata snafu in DBIC 0.08
Validate now croaks instead of throw_exception to play well with DBIx::Class::Exception
Modified: trunk/DBIx-Class-Validation/Changes
===================================================================
--- trunk/DBIx-Class-Validation/Changes 2007-06-24 11:13:13 UTC (rev 3522)
+++ trunk/DBIx-Class-Validation/Changes 2007-06-25 01:14:00 UTC (rev 3523)
@@ -1,5 +1,11 @@
Revision history for DBIx::Class::Validation
+0.02000 Sun June 24 20:04:11 2007
+ - Converted to Class::Accessor::Grouped after mk_classdata
+ snafu in DBIC 0.08
+ - Validate now croaks instead of throw_exception to play
+ well with DBIx::Class::Exception
+
0.01004 Sat May 12 10:45:23 2007
- Use column accessors to set columns instead of set_column
(John Napiorkowski)
Modified: trunk/DBIx-Class-Validation/README
===================================================================
--- trunk/DBIx-Class-Validation/README 2007-06-24 11:13:13 UTC (rev 3522)
+++ trunk/DBIx-Class-Validation/README 2007-06-25 01:14:00 UTC (rev 3523)
@@ -61,9 +61,9 @@
my $profile = sub {
my $result = shift @_;
- return {`
+ return {
required => [qw/email/],
- constraint_methods => {
+ constraint_methods => {
email => sub {
my ($dvf, $val) = @_;
return $result->result_source->resultset->find({email=>$val}) ? 0:1;
Modified: trunk/DBIx-Class-Validation/lib/DBIx/Class/Validation.pm
===================================================================
--- trunk/DBIx-Class-Validation/lib/DBIx/Class/Validation.pm 2007-06-24 11:13:13 UTC (rev 3522)
+++ trunk/DBIx-Class-Validation/lib/DBIx/Class/Validation.pm 2007-06-25 01:14:00 UTC (rev 3523)
@@ -2,22 +2,24 @@
package DBIx::Class::Validation;
use strict;
use warnings;
+our $VERSION = '0.02000';
BEGIN {
- use base qw/DBIx::Class/;
+ use base qw/DBIx::Class Class::Accessor::Grouped/;
use English qw/-no_match_vars/;
use FormValidator::Simple 0.17;
+ use Carp qw/croak/;
+
+ __PACKAGE__->mk_group_accessors('inherited', qw/
+ validation_profile
+ validation_auto
+ validation_filter
+ _validation_module_accessor
+ /);
};
-
-our $VERSION = '0.01004';
-
-__PACKAGE__->mk_classdata('validation_profile');
-__PACKAGE__->mk_classdata('validation_auto' => 1);
-__PACKAGE__->mk_classdata('validation_filter' => 0);
-__PACKAGE__->mk_classdata('_validation_module_accessor');
+__PACKAGE__->validation_auto(1);
__PACKAGE__->validation_module('FormValidator::Simple');
-
=head1 NAME
DBIx::Class::Validation - Validate all data before submitting to your database.
@@ -180,7 +182,7 @@
};
return $result;
} else {
- $self->throw_exception($result);
+ croak $result;
};
};
More information about the Bast-commits
mailing list