Remove Class::Data::Inheritable and use CAG 'inherited' style accessors
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / Constraints.pm
index bc44462..f77db52 100644 (file)
@@ -1,6 +1,8 @@
 package # hide from PAUSE
     DBIx::Class::CDBICompat::Constraints;
 
+use base 'DBIx::Class';
+
 use strict;
 use warnings;
 
@@ -16,7 +18,7 @@ sub constrain_column {
   } elsif (ref $how eq "Regexp") {
     $class->add_constraint(regexp => $col => sub { shift =~ $how });
   } else {
-    $how =~ m/([^:]+)$/;
+    $how =~ m/([^:]+)$/; # match is safe - we throw above on empty $how
     my $try_method = sprintf '_constrain_by_%s', lc $1; # $how->moniker;
     if (my $dispatch = $class->can($try_method)) {
       $class->$dispatch($col => ($how, @_));