[Bast-commits] r7034 - in trunk/DBIx-Class-Validation: . lib/DBIx/Class t

claco at dev.catalyst.perl.org claco at dev.catalyst.perl.org
Sat Jul 11 15:09:12 GMT 2009


Author: claco
Date: 2009-07-11 15:09:11 +0000 (Sat, 11 Jul 2009)
New Revision: 7034

Modified:
   trunk/DBIx-Class-Validation/Changes
   trunk/DBIx-Class-Validation/MANIFEST.SKIP
   trunk/DBIx-Class-Validation/README
   trunk/DBIx-Class-Validation/lib/DBIx/Class/Validation.pm
   trunk/DBIx-Class-Validation/t/fvs.t
   trunk/DBIx-Class-Validation/t/manifest.t
   trunk/DBIx-Class-Validation/t/pod_spelling.t
Log:
Fix bug that skipped validation when setting values while doing an update() like this: $row->update($hashref) (Sergio Salvi) (RT#47709)
Added .git to MANIFEST.SKIP and manifest.t (CLACO)
Various spelling fixes (CLACO)
Fixed SYNOPSIS examples (frioux, RT#47712)

Modified: trunk/DBIx-Class-Validation/Changes
===================================================================
--- trunk/DBIx-Class-Validation/Changes	2009-07-11 12:36:53 UTC (rev 7033)
+++ trunk/DBIx-Class-Validation/Changes	2009-07-11 15:09:11 UTC (rev 7034)
@@ -1,5 +1,12 @@
 Revision history for DBIx::Class::Validation
 
+XXX
+    - Fix bug that skipped validation when setting values while doing an
+        update() like this: $row->update($hashref) (Sergio Salvi) (RT#47709)
+    - Added .git to MANIFEST.SKIP and manifest.t (CLACO)
+    - Various spelling fixes (CLACO)
+    - Fixed SYNOPSIS examples (frioux, RT#47712)
+
 0.02004 Mon Jun 22 12:52:00 2009
     - Switch dependency to DateTime::Format::SQLite
 

Modified: trunk/DBIx-Class-Validation/MANIFEST.SKIP
===================================================================
--- trunk/DBIx-Class-Validation/MANIFEST.SKIP	2009-07-11 12:36:53 UTC (rev 7033)
+++ trunk/DBIx-Class-Validation/MANIFEST.SKIP	2009-07-11 15:09:11 UTC (rev 7034)
@@ -9,6 +9,7 @@
 \bconfig$
 \bbuild$
 \.DS_Store$
+\.git
 
 # Avoid Makemaker generated and utility files.
 \bMakefile$

Modified: trunk/DBIx-Class-Validation/README
===================================================================
--- trunk/DBIx-Class-Validation/README	2009-07-11 12:36:53 UTC (rev 7033)
+++ trunk/DBIx-Class-Validation/README	2009-07-11 15:09:11 UTC (rev 7034)
@@ -12,7 +12,7 @@
       __PACKAGE__->validation(
         module => 'FormValidator::Simple',
         profile => { ... },
-        filters => 0,
+        filter => 0,
         auto => 1,
       );
 
@@ -28,7 +28,7 @@
       __PACKAGE__->validation(
         module => 'FormValidator::Simple',
         profile => { ... },
-        filters => 0,
+        filter => 0,
         auto => 1,
       );
 
@@ -60,8 +60,8 @@
 
         my $profile = sub {
             my $result = shift @_;
-        
-        return {
+    
+            return {
                 required => [qw/email/],
                 constraint_methods => {
                     email => sub {
@@ -117,10 +117,15 @@
 AUTHOR
     Aran C. Deltac <bluefeet at cpan.org>
 
-CONTRIBUTERS
-    Tom Kirkpatrick <tkp at cpan.org> Christopher Laco <claco at cpan.org> John
-    Napiorkowski <jjn1056 at yahoo.com>
+CONTRIBUTORS
+    Tom Kirkpatrick <tkp at cpan.org>
 
+    Christopher Laco <claco at cpan.org>
+
+    John Napiorkowski <jjn1056 at yahoo.com>
+
+    Sergio Salvi <sergio at developerl.com>
+
 LICENSE
     You may distribute this code under the same terms as Perl itself.
 

Modified: trunk/DBIx-Class-Validation/lib/DBIx/Class/Validation.pm
===================================================================
--- trunk/DBIx-Class-Validation/lib/DBIx/Class/Validation.pm	2009-07-11 12:36:53 UTC (rev 7033)
+++ trunk/DBIx-Class-Validation/lib/DBIx/Class/Validation.pm	2009-07-11 15:09:11 UTC (rev 7034)
@@ -35,7 +35,7 @@
   __PACKAGE__->validation(
     module => 'FormValidator::Simple',
     profile => { ... },
-    filters => 0,
+    filter => 0,
     auto => 1,
   );
 
@@ -53,7 +53,7 @@
   __PACKAGE__->validation(
     module => 'FormValidator::Simple',
     profile => { ... },
-    filters => 0,
+    filter => 0,
     auto => 1,
   );
 
@@ -208,6 +208,9 @@
 
 sub update {
     my $self = shift;
+    my $columns = shift;
+
+    $self->set_inflated_columns($columns) if $columns;
     $self->validate if $self->validation_auto;
     $self->next::method(@_);
 };
@@ -225,12 +228,16 @@
 
 Aran C. Deltac <bluefeet at cpan.org>
 
-=head1 CONTRIBUTERS
+=head1 CONTRIBUTORS
 
 Tom Kirkpatrick <tkp at cpan.org>
+
 Christopher Laco <claco at cpan.org>
+
 John Napiorkowski <jjn1056 at yahoo.com>
 
+Sergio Salvi <sergio at developerl.com>
+
 =head1 LICENSE
 
 You may distribute this code under the same terms as Perl itself.

Modified: trunk/DBIx-Class-Validation/t/fvs.t
===================================================================
--- trunk/DBIx-Class-Validation/t/fvs.t	2009-07-11 12:36:53 UTC (rev 7033)
+++ trunk/DBIx-Class-Validation/t/fvs.t	2009-07-11 15:09:11 UTC (rev 7034)
@@ -5,7 +5,7 @@
 
 BEGIN {
     use lib 't/lib';
-    use DBIC::Test tests => 16;
+    use DBIC::Test tests => 17;
 }
 
 my $schema = DBIC::Test->init_schema;
@@ -32,6 +32,9 @@
 $row->update;
 is $row->name, 'food', 'valid data accepted';
 
+eval { $row->update({ name => "a" }) };
+isa_ok $@, 'FormValidator::Simple::Results', '$row->update($fields) also goes through validation';
+
 # without auto on update
 $row->validation_auto(0);
 $row->name('yo');
@@ -79,4 +82,4 @@
     pass;
 } else {
     fail('throw exceptionb when module does not support check');
-};
\ No newline at end of file
+};

Modified: trunk/DBIx-Class-Validation/t/manifest.t
===================================================================
--- trunk/DBIx-Class-Validation/t/manifest.t	2009-07-11 12:36:53 UTC (rev 7033)
+++ trunk/DBIx-Class-Validation/t/manifest.t	2009-07-11 15:09:11 UTC (rev 7034)
@@ -17,6 +17,6 @@
 
 ok_manifest({
     exclude => ['/t/var', '/cover_db'],
-    filter  => [qr/\.svn/, qr/cover/, qr/Build(.(PL|bat))?/, qr/_build/, qr/\.tmproj/],
+    filter  => [qr/\.git/, qr/\.svn/, qr/cover/, qr/Build(.(PL|bat))?/, qr/_build/, qr/\.tmproj/],
     bool    => 'or'
 });

Modified: trunk/DBIx-Class-Validation/t/pod_spelling.t
===================================================================
--- trunk/DBIx-Class-Validation/t/pod_spelling.t	2009-07-11 12:36:53 UTC (rev 7033)
+++ trunk/DBIx-Class-Validation/t/pod_spelling.t	2009-07-11 15:09:11 UTC (rev 7034)
@@ -23,6 +23,7 @@
 Aran
 Deltac
 Laco
+Salvi
 INSERTs
 UPDATEs
 pre




More information about the Bast-commits mailing list