From: Peter Rabbitson Date: Thu, 11 Jun 2009 14:15:53 +0000 (+0000) Subject: Use equality, not comparison X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0bad18237edb8e1967fede05b9e5bcf13799f52c;p=dbsrgits%2FDBIx-Class-Historic.git Use equality, not comparison --- diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 0cc0074..aa636a7 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -121,7 +121,7 @@ L. Set this to a true or false value (not C) to explicitly specify if this column contains numeric data. This controls how set_column decides whether to consider a column dirty after an update: if -C is true a numeric comparison C<< <=> >> will take place +C is true a numeric comparison C<< != >> will take place instead of the usual C If not specified the storage class will attempt to figure this out on diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index e583f2b..b2eee57 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -793,7 +793,7 @@ sub set_column { } if ($colinfo->{is_numeric}) { - $dirty = $old_value <=> $new_value; + $dirty = $old_value != $new_value; } else { $dirty = 1; diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 77ef8b7..c6f13f5 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1564,7 +1564,7 @@ sub bind_attribute_by_data_type { Given a datatype from column_info, returns a boolean value indicating if the current RDBMS considers it a numeric value. This controls how L decides whether to mark the column as -dirty - when the datatype is deemed numeric a C<< <=> >> comparison will +dirty - when the datatype is deemed numeric a C<< != >> comparison will be performed instead of the usual C. =cut