]> git.mjollnir.org Git - cil.git/commitdiff
Instead of using eval when setting a value, do it normally.
authorAndrew Chilton <andychilton@gmail.com>
Mon, 23 Jun 2008 11:32:31 +0000 (23:32 +1200)
committerAndrew Chilton <andychilton@gmail.com>
Mon, 23 Jun 2008 11:32:31 +0000 (23:32 +1200)
This was added since DateTime b0rks when it compares itself to other things.
So, instead of passing around a DateTime object, we just stringify it straight
away because that's all we want anyway.

lib/CIL/Base.pm

index ed5c3a81ce0e35617009ea5cda62e4e115e83be6..feb7dfc0ec9b01cdb2a17e19af389d2ca57b10e2 100644 (file)
@@ -125,7 +125,7 @@ sub set {
 
     # finish if both are defined and they're the same
     if ( defined $orig and defined $value ) {
-        return if eval { $orig eq $value };
+        return if $orig eq $value;
     }
 
     # finish if neither are defined
@@ -147,7 +147,7 @@ sub set_no_update {
 
 sub set_inserted_now {
     my ($self) = @_;
-    my $time = DateTime->now;
+    my $time = '' . DateTime->now;
     $self->{data}{Inserted} = $time;
     $self->{data}{Updated} = $time;
     $self->{Changed} = 1;
@@ -155,7 +155,7 @@ sub set_inserted_now {
 
 sub set_updated_now {
     my ($self) = @_;
-    my $time = DateTime->now;
+    my $time = '' . DateTime->now;
     $self->{data}{Updated} = $time;
     $self->{Changed} = 1;
 }