[Rt-commit] r3850 - in Jifty-DBI/trunk: . lib/Jifty/DBI

alexmv at bestpractical.com alexmv at bestpractical.com
Tue Sep 13 13:39:42 EDT 2005


Author: alexmv
Date: Tue Sep 13 13:39:42 2005
New Revision: 3850

Modified:
   Jifty-DBI/trunk/   (props changed)
   Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm
Log:
 r6354 at zoq-fot-pik:  chmrr | 2005-09-13 13:38:31 -0400
  * ->new doean't always get calle,d if we're loading from a session,
    for instance.  Call ->_init_columns during AUTOLOAD as well to make
    sure it happens in time
  * When determining REFERENCES, we need to make sure the class is
    loaded before trying to muck around with its ISA


Modified: Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm
==============================================================================
--- Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm	(original)
+++ Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm	Tue Sep 13 13:39:42 2005
@@ -297,6 +297,8 @@
 sub AUTOLOAD {
     my $self = $_[0];
 
+    $self->_init_columns() unless $self->COLUMNS;
+
     my ( $column_name, $action ) = $self->_parse_autoload_method($AUTOLOAD);
 
     unless ( $action and $column_name ) {
@@ -487,6 +489,7 @@
         my $refclass = $schema->{$column_name}{'REFERENCES'} || $schema->{$column_name}{'references'};
 
         if ($refclass) {
+            $refclass->require();
             if ( UNIVERSAL::isa( $refclass, 'Jifty::DBI::Record' ) ) {
                 if ( $column_name =~ /(.*)_id$/ ) {
 


More information about the Rt-commit mailing list