[Bast-commits] r3792 - in trunk/DBIx-Class-FormTools: .
lib/DBIx/Class
djo at dev.catalyst.perl.org
djo at dev.catalyst.perl.org
Wed Sep 26 22:33:46 GMT 2007
Author: djo
Date: 2007-09-26 22:33:46 +0100 (Wed, 26 Sep 2007)
New Revision: 3792
Modified:
trunk/DBIx-Class-FormTools/
trunk/DBIx-Class-FormTools/Changes
trunk/DBIx-Class-FormTools/lib/DBIx/Class/FormTools.pm
Log:
r37697 at blacksun: djo | 2007-09-26 22:37:21 +0200
Fixed fieldname bug
When $object->source_name returns undef, we now use the ref name of the class
when generating the field key.
Property changes on: trunk/DBIx-Class-FormTools
___________________________________________________________________
Name: svk:merge
- 78d5d833-3a7e-474d-aed6-cfba645156b5:/local/DBIx-Class-FormTools.trunk:8849
+ 78d5d833-3a7e-474d-aed6-cfba645156b5:/local/DBIx-Class-FormTools.trunk:37697
Modified: trunk/DBIx-Class-FormTools/Changes
===================================================================
--- trunk/DBIx-Class-FormTools/Changes 2007-09-26 16:13:23 UTC (rev 3791)
+++ trunk/DBIx-Class-FormTools/Changes 2007-09-26 21:33:46 UTC (rev 3792)
@@ -1,5 +1,9 @@
Revision history for DBIx-Class-FormTools
+0.0.6 Wed Sep 26 22:33:44 CEST 2007
+ - Fixed fieldname bug we now use the ref name of the class when
+ source_name returns undef
+
0.0.5 Wed Jul 19 14:14:21 CEST 2006
- Fixed version number in docs
- Redesigned module as a helper. Warning: Incompatible with 0.0.4
Modified: trunk/DBIx-Class-FormTools/lib/DBIx/Class/FormTools.pm
===================================================================
--- trunk/DBIx-Class-FormTools/lib/DBIx/Class/FormTools.pm 2007-09-26 16:13:23 UTC (rev 3791)
+++ trunk/DBIx-Class-FormTools/lib/DBIx/Class/FormTools.pm 2007-09-26 21:33:46 UTC (rev 3792)
@@ -230,7 +230,7 @@
my ($self,$object,$attribute,$object_id,$foreign_object_ids) = @_;
# Get class name
- my $class = $object->source_name;
+ my $class = $object->source_name || ref($object);
my @primary_keys = $object->primary_columns;
@@ -240,7 +240,7 @@
my %id_fields = ();
foreach my $primary_key ( @primary_keys ) {
# Field is foreign key
- if ( exists $relationships{$primary_key} ) {;
+ if ( exists $relationships{$primary_key} ) {
$id_fields{$primary_key} = $foreign_object_ids->{$primary_key};
}
# Field is local
More information about the Bast-commits
mailing list