[Bps-public-commit] r16065 - in Prophet/branches/dispatcher: lib/Prophet

sartak at bestpractical.com sartak at bestpractical.com
Thu Sep 25 15:34:50 EDT 2008


Author: sartak
Date: Thu Sep 25 15:34:49 2008
New Revision: 16065

Modified:
   Prophet/branches/dispatcher/   (props changed)
   Prophet/branches/dispatcher/lib/Prophet/CLIContext.pm

Log:
 r72467 at onn:  sartak | 2008-09-25 15:34:32 -0400
 fixes for type_to_record_class


Modified: Prophet/branches/dispatcher/lib/Prophet/CLIContext.pm
==============================================================================
--- Prophet/branches/dispatcher/lib/Prophet/CLIContext.pm	(original)
+++ Prophet/branches/dispatcher/lib/Prophet/CLIContext.pm	Thu Sep 25 15:34:49 2008
@@ -329,13 +329,19 @@
 sub _type_to_record_class {
     my $self = shift;
     my $type = shift;
-    my $try = $self->app_class . "::Model::" . ucfirst( lc($type) );
-    Prophet::App->try_to_require($try);    # don't care about fails
+
+    my $app = $self->app_handle;
+    my $app_class = blessed($app);
+
+    my $try = $app_class . "::Model::" . ucfirst( lc($type) );
+    $app->try_to_require($try);    # don't care about fails
     return $try if ( $try->isa('Prophet::Record') );
 
-    $try = $self->app_class . "::Record";
-    Prophet::App->try_to_require($try);    # don't care about fails
+    $try = $app_class . "::Record";
+    $app->try_to_require($try);    # don't care about fails
     return $try if ( $try->isa('Prophet::Record') );
+
+    require Prophet::Record;
     return 'Prophet::Record';
 }
 



More information about the Bps-public-commit mailing list