[Jifty-commit] r3537 - in jifty/branches/virtual-models: .
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Wed Jun 20 12:30:09 EDT 2007
Author: sterling
Date: Wed Jun 20 12:30:09 2007
New Revision: 3537
Modified:
jifty/branches/virtual-models/ (props changed)
jifty/branches/virtual-models/lib/Jifty/Model/ModelClass.pm
Log:
r7745 at riddle: andrew | 2007-06-20 11:26:23 -0500
Automatically loading a DB-backed Collection after creating the record class.
Modified: jifty/branches/virtual-models/lib/Jifty/Model/ModelClass.pm
==============================================================================
--- jifty/branches/virtual-models/lib/Jifty/Model/ModelClass.pm (original)
+++ jifty/branches/virtual-models/lib/Jifty/Model/ModelClass.pm Wed Jun 20 12:30:09 2007
@@ -197,6 +197,11 @@
# At that point, the instantiation of db-backed classes should move into the classloader
if ($@) { die $@; }
$INC{$path} = '#autoloaded';
+
+ # Cause the new record's collection to be auto-generated by the ClassLoader
+ # to make it appear magically with record.
+ eval "use ${fully_qualified_class}Collection";
+ if ($@) { die $@; }
}
=head2 validate_super_classes
More information about the Jifty-commit
mailing list