[Jifty-commit] r1173 - in jifty/trunk: lib/Jifty
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Mon Jun 5 22:54:11 EDT 2006
Author: jesse
Date: Mon Jun 5 22:54:11 2006
New Revision: 1173
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Record.pm
Log:
r12196 at pinglin: jesse | 2006-06-05 22:53:30 -0400
* If a FK column has a null value and the user asks for the column's foreign record, we should give them an empty record, not undef
Modified: jifty/trunk/lib/Jifty/Record.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Record.pm (original)
+++ jifty/trunk/lib/Jifty/Record.pm Mon Jun 5 22:54:11 2006
@@ -298,14 +298,13 @@
my $column = $self->column($column_name);
my $classname = $column->refers_to();
- return unless defined $value;
return undef unless $classname;
return unless $classname->isa( 'Jifty::Record' );
# XXX TODO FIXME we need to figure out the right way to call new here
# perhaps the handle should have an initiializer for records/collections
my $object = $classname->new(current_user => $self->current_user);
- $object->load_by_cols(( $column->by || 'id') => $value);
+ $object->load_by_cols(( $column->by || 'id') => $value) if ($value);
return $object;
}
More information about the Jifty-commit
mailing list