[Jifty-commit] r2411 - in jifty/branches/template-declare: . lib

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Dec 20 02:57:06 EST 2006


Author: jesse
Date: Wed Dec 20 02:57:05 2006
New Revision: 2411

Modified:
   jifty/branches/template-declare/   (props changed)
   jifty/branches/template-declare/lib/Jifty.pm
   jifty/branches/template-declare/lib/Jifty/ClassLoader.pm

Log:
 r46334 at dhcp64-134-35-102:  jesse | 2006-12-19 20:35:19 -0800
 * Switch to requiring the View class after all the models are loaded


Modified: jifty/branches/template-declare/lib/Jifty.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty.pm	(original)
+++ jifty/branches/template-declare/lib/Jifty.pm	Wed Dec 20 02:57:05 2006
@@ -152,6 +152,9 @@
     Jifty->handler(Jifty::Handler->new());
     Jifty->api(Jifty::API->new());
 
+    # We can only require view classes once we have our models and actions set.
+    $class_loader->require_views;
+
     # Let's get the database rocking and rolling
     Jifty->setup_database_connection(%args);
 

Modified: jifty/branches/template-declare/lib/Jifty/ClassLoader.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/ClassLoader.pm	(original)
+++ jifty/branches/template-declare/lib/Jifty/ClassLoader.pm	Wed Dec 20 02:57:05 2006
@@ -217,7 +217,6 @@
         except  => qr/\.#/,
         inner   => 0
     );
-    Jifty::Util->require($base."::View");
     };
     
     if ($@) {
@@ -234,6 +233,16 @@
     }
 }
 
+sub require_views {
+    my $self = shift;
+    
+    my $base = $self->{base};
+    # if we don't even have an application class, this trick will not work
+    return unless ($base); 
+    Jifty::Util->require($base);
+    Jifty::Util->require($base."::View");
+}
+
 =head2 models
 
 Accessor to the list of models this application has loaded.


More information about the Jifty-commit mailing list