[Dbix-class] Schema::Loader Fix

victori at lamer0.com victori at lamer0.com
Tue Nov 14 23:26:00 GMT 2006


Quick fix concerning schema::loader. I ran into the issue with  
relationships not being generated correctly.

Schema::Loader outputted code such as:

__PACKAGE__->has_many("logins", "Logins", { "foreign.role" =>  
"self.id" });

Which should of been :

__PACKAGE__->has_many("logins", "DB::ClassName::Schema::Logins",  
{ "foreign.role" => "self.id" });

When doing something like

$user->role($role_reference);  it would not Accept it since it looked  
for 'Roles' and the reference was the full class name  
'DB::ClassName::Schema::Roles'

Everything seems to be working fine with this fix.

Here is the fix:

--- DBIx-Class-Schema-Loader-0.03008/lib/DBIx/Class/Schema/Loader/ 
RelBuilder.pm	2006-10-20 11:17:10.000000000 -0700
+++ ebusinesssphere/lib/DBIx/Class/Schema/Loader/RelBuilder.pm	 
2006-11-14 14:59:00.000000000 -0800
@@ -194,7 +194,7 @@
              push(@{$all_code->{$local_class}},
                  { method => 'belongs_to',
                    args => [ $remote_relname,
-                            $remote_moniker,
+                            $remote_class,
                              \%cond,
                    ],
                  }
@@ -203,7 +203,7 @@
              push(@{$all_code->{$remote_class}},
                  { method => 'has_many',
                    args => [ $local_relname,
-                            $local_moniker,
+                            $local_class,
                              \%rev_cond,
                    ],
                  }








More information about the Dbix-class mailing list