[Jifty-commit] jifty-dbi branch, master, updated. 0.72-2-ge126c91

Jifty commits jifty-commit at lists.jifty.org
Wed Jan 25 15:43:05 EST 2012


The branch, master has been updated
       via  e126c9124c657963b180dd42102519140c4e41dd (commit)
      from  203f8bb34973aeb3c1e8baa65816346fb12eccfd (commit)

Summary of changes:
 lib/Jifty/DBI/Column.pm |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit e126c9124c657963b180dd42102519140c4e41dd
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Jan 25 15:20:35 2012 -0500

    Avoid a compilation failure caused by incorrect precedence
    
    The intended assignment on the else side of the ternary operator needs
    to be in quotes since ?: binds tighter than =.  Rather than just add the
    parens and be done with it, clarify the code a little.
    
    Apparently Perl previously passed this by without making a fuss.  It
    started failing to compile on blead as of v5.15.6-118-g2846acb.  See the
    bug report at rt.cpan.org #74298.

diff --git a/lib/Jifty/DBI/Column.pm b/lib/Jifty/DBI/Column.pm
index d828084..f47ad5e 100644
--- a/lib/Jifty/DBI/Column.pm
+++ b/lib/Jifty/DBI/Column.pm
@@ -91,7 +91,11 @@ sub new {
     # not in @attrs into attributes and just pass the whole hash
     $self->attributes({});
     for (keys %$args) {
-        $self->can($_) ? $self->$_($args->{$_}) : $self->attributes->{$_} = $args->{$_};
+        if ($self->can($_)) {
+            $self->$_($args->{$_});
+        } else {
+            $self->attributes->{$_} = $args->{$_};
+        }
     }
 
     return $self;

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


More information about the Jifty-commit mailing list