Remove Class::Data::Inheritable and use CAG 'inherited' style accessors
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / Relationships.pm
index 05afe74..abd6783 100644 (file)
@@ -3,10 +3,11 @@ package # hide from PAUSE
 
 use strict;
 use warnings;
-use base 'Class::Data::Inheritable';
+use base 'DBIx::Class';
 
 use Clone;
 use DBIx::Class::CDBICompat::Relationship;
+use Scalar::Util 'blessed';
 use DBIx::Class::_Util qw(quote_sub perlstring);
 
 __PACKAGE__->mk_classdata('__meta_info' => {});
@@ -200,8 +201,11 @@ sub search {
                   : undef());
   if (ref $where eq 'HASH') {
     foreach my $key (keys %$where) { # has_a deflation hack
-      $where->{$key} = ''.$where->{$key}
-        if eval { $where->{$key}->isa('DBIx::Class') };
+      $where->{$key} = ''.$where->{$key} if (
+        defined blessed $where->{$key}
+          and
+        $where->{$key}->isa('DBIx::Class')
+      );
     }
   }
   $self->next::method($where, $attrs);