[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-585-g4ac52c8

Jesse Vincent jesse at bestpractical.com
Wed Aug 25 22:58:20 EDT 2010


The branch, 3.9-trunk has been updated
       via  4ac52c86b83ef961d0151d7ae71eed5df9b0c004 (commit)
       via  1e370f63ff3f8c4749c19a724553ecf68a9eee9c (commit)
       via  0a2ed3f32b6f0bd4e743a6a634473e49071ab557 (commit)
       via  b7f5c7d61670f2fc9766db32ad6fe40224416370 (commit)
       via  3a3cc9c771995d8c56c81d28dbd745acbd944dc0 (commit)
      from  8f37429cddfb6604eef1293278e4dbe1051c387d (commit)

Summary of changes:
 lib/RT/Record.pm |   20 ++++++++++++++------
 t/api/link.t     |    1 +
 t/i18n/default.t |    2 +-
 3 files changed, 16 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit 3a3cc9c771995d8c56c81d28dbd745acbd944dc0
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Aug 25 21:41:24 2010 -0400

    Make sure RT::Record actually uses our id sub.

diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index 02bf588..b13bf03 100755
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -109,6 +109,7 @@ sub Id {
     return shift->{values}->{id};
 }
 
+*id = \&Id;
 
 =head2 Delete
 

commit b7f5c7d61670f2fc9766db32ad6fe40224416370
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Aug 25 22:00:28 2010 -0400

    rather than using an expensive AUTOLOADed "validate" sub, use "can" to
    see if it exists.

diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index b13bf03..c1ad52f 100755
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -270,8 +270,8 @@ sub Create {
     my $self    = shift;
     my %attribs = (@_);
     foreach my $key ( keys %attribs ) {
-        my $method = "Validate$key";
-        unless ( $self->$method( $attribs{$key} ) ) {
+        if (my $method = $self->can("Validate$key")) {
+        if (! $method->( $self, $attribs{$key} ) ) {
             if (wantarray) {
                 return ( 0, $self->loc('Invalid value for [_1]', $key) );
             }
@@ -279,6 +279,7 @@ sub Create {
                 return (0);
             }
         }
+        }
     }
     my $now = RT::Date->new( $self->CurrentUser );
     $now->Set( Format => 'unix', Value => time );

commit 0a2ed3f32b6f0bd4e743a6a634473e49071ab557
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Aug 25 22:00:54 2010 -0400

    Rather than using RT::Date to get an ISO for "now", build it from
    gmtime.

diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index c1ad52f..25d7ebb 100755
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -281,14 +281,20 @@ sub Create {
         }
         }
     }
-    my $now = RT::Date->new( $self->CurrentUser );
-    $now->Set( Format => 'unix', Value => time );
-    $attribs{'Created'} = $now->ISO() if ( $self->_Accessible( 'Created', 'auto' ) && !$attribs{'Created'});
+
+
+
+    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$ydaym,$isdst,$offset) = gmtime();
+
+    my $now_iso =
+     sprintf("%04d-%02d-%02d %02d:%02d:%02d", ($year+1900), ($mon+1), $mday, $hour, $min, $sec);
+
+    $attribs{'Created'} = $now_iso if ( $self->_Accessible( 'Created', 'auto' ) && !$attribs{'Created'});
 
     if ($self->_Accessible( 'Creator', 'auto' ) && !$attribs{'Creator'}) {
          $attribs{'Creator'} = $self->CurrentUser->id || '0'; 
     }
-    $attribs{'LastUpdated'} = $now->ISO()
+    $attribs{'LastUpdated'} = $now_iso
       if ( $self->_Accessible( 'LastUpdated', 'auto' ) && !$attribs{'LastUpdated'});
 
     $attribs{'LastUpdatedBy'} = $self->CurrentUser->id || '0'

commit 1e370f63ff3f8c4749c19a724553ecf68a9eee9c
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Aug 25 22:45:06 2010 -0400

    t/api/link.t got broken during clkao's refactoring.

diff --git a/t/api/link.t b/t/api/link.t
index e99420a..f8b86ba 100644
--- a/t/api/link.t
+++ b/t/api/link.t
@@ -8,6 +8,7 @@ use RT::Test::Web;
 use RT::Link;
 my $link = RT::Link->new($RT::SystemUser);
 
+use RT::Test::Web;
 
 ok (ref $link);
 isa_ok( $link, 'RT::Link');

commit 4ac52c86b83ef961d0151d7ae71eed5df9b0c004
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Aug 25 22:59:04 2010 -0400

    t/i18n/default.t actually _do_ need a working database

diff --git a/t/i18n/default.t b/t/i18n/default.t
index d580f97..c66cc6d 100644
--- a/t/i18n/default.t
+++ b/t/i18n/default.t
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 
-use RT::Test nodb => 1, tests => 8;
+use RT::Test nodb => 0, tests => 8;
 
 my ($baseurl, $m) = RT::Test->started_ok;
 $m->get_ok('/');

-----------------------------------------------------------------------


More information about the Rt-commit mailing list