handle digits when splitting by case transition
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / RelBuilder.pm
index 7611f75..7847c77 100644 (file)
@@ -5,6 +5,7 @@ use warnings;
 use Class::C3;
 use Carp::Clan qw/^DBIx::Class/;
 use Lingua::EN::Inflect::Phrase ();
+use DBIx::Class::Schema::Loader::Constants 'BY_CASE_TRANSITION';
 
 our $VERSION = '0.07000';
 
@@ -215,7 +216,7 @@ sub _remote_attrs {
 sub _normalize_name {
     my ($self, $name) = @_;
 
-    my @words = split /(?<=[[:lower:]])[\W_]*(?=[[:upper:]])|[\W_]+/, $name;
+    my @words = split BY_CASE_TRANSITION, $name;
 
     return join '_', map lc, @words;
 }