removed some dead code, added fix and test for _execute_array_empty
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat.pm
index ee797a2..835adfe 100644 (file)
@@ -5,11 +5,20 @@ use warnings;
 use base qw/DBIx::Class::Core DBIx::Class::DB/;
 use Carp::Clan qw/^DBIx::Class/;
 
-eval {
-  require Class::Trigger;
-  require DBIx::ContextualFetch;
-};
-croak "Class::Trigger and DBIx::ContextualFetch is required for CDBICompat" if $@;
+# Modules CDBICompat needs that DBIx::Class does not.
+my @Extra_Modules = qw(
+    Class::Trigger
+    DBIx::ContextualFetch
+    Clone
+);
+
+my @didnt_load;
+for my $module (@Extra_Modules) {
+    push @didnt_load, $module unless eval qq{require $module};
+}
+croak("@{[ join ', ', @didnt_load ]} are missing and are required for CDBICompat")
+    if @didnt_load;
+
 
 __PACKAGE__->load_own_components(qw/
   Constraints
@@ -77,7 +86,7 @@ The features of CDBI::Sweet are better done using DBIC methods which are almost
 
 =head3 Class::DBI::Plugin::DeepAbstractSearch
 
-This is better done using DBIC's native search facilities.  The major difference is that DBIC will not infer the join for you, you have to tell it the join tables.
+This plugin will work, but it is more efficiently done using DBIC's native search facilities.  The major difference is that DBIC will not infer the join for you, you have to tell it the join tables.
 
 
 =head2 Choosing Features
@@ -140,13 +149,13 @@ Relationships between tables (has_a, has_many...) must be delcared after all tab
 
     package Foo;
     use base qw(Class::DBI);
-    
+
     Foo->table("foo");
     Foo->columns( All => qw(this that bar) );
 
     package Bar;
     use base qw(Class::DBI);
-    
+
     Bar->table("bar");
     Bar->columns( All => qw(up down) );