[Nitro] Again boolean bug in Og

Michael Neumann mneumann at ntecs.de
Thu Jan 27 12:37:20 EST 2005


Hi,

The version you send me has still problems.

If I reload the domain object, the boolean value is always "false".

It's due to:

   UPDATE..... done=true

And then in self.read_prop (Pg backend) you do:

   't' == res.getvalue(...)



This patch will help:


--- psql.rb.old 2005-01-27 18:31:05.000000000 +0100
+++ psql.rb     2005-01-27 18:36:56.000000000 +0100
@@ -111,7 +111,7 @@
                 elsif p.klass.ancestors.include?(Date)
                         return %|#\{@#{p.symbol} ? 
"'#\{Og::PsqlBackend.date(@#{p.symbol})\}'" : 'NULL'\}|
                 elsif p.klass.ancestors.include?(TrueClass)
-                       return "#\{@#{p.symbol} || 'NULL'\}"
+                       return "#\{@#{p.symbol} ? \"'t'\" : 'NULL' \}"
                 else
                         return %|#\{@#{p.symbol} ? 
"'#\{Og::PsqlBackend.escape(@#{p.symbol}.to_yaml)\}'" : "''"\}|
                 end




Regards,

   Michael



More information about the Nitro-general mailing list