Changed how the rules are kept up to date with source names and went through 3 CPAN...
Rob Kinyon [Wed, 11 Nov 2009 13:50:51 +0000 (08:50 -0500)]
.gitignore [new file with mode: 0644]
Changes
lib/DBIx/Class/Fixtures.pm
t/var/configs/rules.json

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..3268211
--- /dev/null
@@ -0,0 +1 @@
+.*.sw?
diff --git a/Changes b/Changes
index 0d16e98..5c0efcb 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,15 @@
 Revision history for DBIx-Class-Fixtures
 
+1.001008
+- Man, I should test better.
+
+1.001007
+- Should use Schema->source(), not ->resultset().
+
+1.001006
+- Schema->resultset() throws an exception, not return undef, when it can't find
+  a moniker.
+
 1.001005
 - Fixed problem where rules containing an override of has_many weren't applied
   correctly.
index dab2d3a..974ad06 100644 (file)
@@ -26,11 +26,11 @@ __PACKAGE__->mk_group_accessors( 'simple' => qw/config_dir
 
 =head1 VERSION
 
-Version 1.001005
+Version 1.001008
 
 =cut
 
-our $VERSION = '1.001005';
+our $VERSION = '1.001008';
 
 =head1 NAME
 
@@ -525,8 +525,8 @@ sub dump {
   my @sources = sort { $a->{class} cmp $b->{class} } @{delete $config->{sets}};
 
   while ( my ($k,$v) = each %{ $config->{rules} } ) {
-    if ( my $rs = $schema->resultset($k) ) {
-      $config->{rules}{$rs->result_source->source_name} = $v;
+    if ( my $source = eval { $schema->source($k) } ) {
+      $config->{rules}{$source->source_name} = $v;
     }
   }
 
index 6d44f93..fb0412d 100644 (file)
@@ -17,6 +17,9 @@
             }]
         }],
         "rules": {
+            "might_have": {
+                "fetch": 0
+            },
             "CD": {
                 "cond": [{ "tags.tag": "Cheesy" }],
                 "join": ["tags"],