Merge branch 'cngarrison-test-fix'
[dbsrgits/DBIx-Class-Fixtures.git] / lib / DBIx / Class / Fixtures.pm
index 7a2c4af..376ce4a 100644 (file)
@@ -572,7 +572,7 @@ C<schema> and C<directory> are required attributes. also, one of C<config> or C<
 be specified.
 
 The optional parameter C<excludes> takes an array ref of source names and can be
-used to exclue those sources when dumping the whole schema. This is useful if
+used to exclude those sources when dumping the whole schema. This is useful if
 you have views in there, since those do not need fixtures and will currently result
 in an error when they are created and then used with C<populate>.
 
@@ -650,7 +650,7 @@ sub dump {
   $tmp_output_dir->file('_config_set')->print( Dumper $config );
 
   $config->{rules} ||= {};
-  my @sources = sort { $a->{class} cmp $b->{class} } @{delete $config->{sets}};
+  my @sources = @{delete $config->{sets}};
 
   while ( my ($k,$v) = each %{ $config->{rules} } ) {
     if ( my $source = eval { $schema->source($k) } ) {
@@ -880,8 +880,8 @@ sub dump_object {
 
     # mess with dates if specified
     if ($set->{datetime_relative}) {
-      my $formatter= $object->result_source->schema->storage->datetime_parser;
-      unless ($@ || !$formatter) {
+      my $formatter= eval {$object->result_source->schema->storage->datetime_parser};
+      unless (!$formatter) {
         my $dt;
         if ($set->{datetime_relative} eq 'today') {
           $dt = DateTime->today;
@@ -1597,4 +1597,4 @@ sub _name_for_source {
 
 =cut
 
-1;
\ No newline at end of file
+1;