Subject: | patch to allow 0 (zero) as params value |
example:
my $root_id = $tree->add_child_to_right(name => "my_thing", my_other_id
=> 0); ##-- my_other_id now NULL in DB
because _get_params_and_values() is doing:
push @values, $params->{$column}||''
.. fixed by checking for defined $params->{$column}
Subject: | NestedSet.pm-zero_as_param_value.diff |
--- NestedSet.pm.orig 2007-10-27 05:15:09.000000000 -0500
+++ NestedSet.pm 2007-10-27 05:15:30.000000000 -0500
@@ -324,7 +324,7 @@
foreach my $column (keys %$params){
if (not defined $ignore{$column}){
push @params, $column;
- push @values, $params->{$column}||''
+ push @values, (defined $params->{$column} ? $params->{$column} : '');
}
}
return (\@params,\@values);