Changes corrected/updated
Brandon L. Black [Mon, 22 May 2006 19:39:00 +0000 (19:39 +0000)]
create=static implemented

Changes
lib/Catalyst/Helper/Model/DBIC/Schema.pm

diff --git a/Changes b/Changes
index 44403d0..83f7c7f 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,8 +1,16 @@
 Revision history for Perl extension Catalyst::Model::DBIC::Schema
 
+0.14    Not yet released - do not release before Schema::Loader 0.0300x is out and slightly stabilized!!
+        - Helpers merged, helper syntax changed
+        - Everything updated for Schema::Loader 0.03 support, including
+          what amounts to using Loader in one-shot mode to generate
+          a manual Schema with matching Model.
         - fixed stupid typo in docs
 
-0.12
+0.13  Wed Apr 26 2006
+        - noted support via mailing lists
+
+0.12  Tue Apr 25 2006
         - SYNOPSIS improved substantially to help newbies get started
 
 0.11  Sun Mar 26 17:22:31 UTC 2006
index 6f4ff9d..b70b86e 100644 (file)
@@ -3,6 +3,7 @@ package Catalyst::Helper::Model::DBIC::Schema;
 use strict;
 use warnings;
 use Carp;
+use UNIVERSAL::require;
 
 =head1 NAME
 
@@ -102,8 +103,14 @@ sub mk_compclass {
         $helper->render_file( 'schemaclass', $schema_file );
     }
     elsif($create eq 'static') {
-       die "Unimplemented ...";
-       # XXX make a loader class in memory with dumpdir set to our base+lib, and load it.
+       my $schema_dir  = File::Spec->catfile( $helper->{base}, 'lib' );
+       DBIx::Class::Schema::Loader->use("dump_to_dir:$schema_dir", 'make_schema_at')
+           or die "Cannot load DBIx::Class::Schema::Loader: $@";
+       make_schema_at(
+           $schema_class,
+           { relationships => 1 },
+           \@connect_info,
+       );
     }
 }