Revision history for Perl extension DBIx::Class::Schema::Loader
+ - fix bug in qualify_objects that would add schema to relnames
+ - better type info for Informix, except for DATETIME precision and
+ INTERVAL support
- better type info for DB2
- fix some newly-introduced test bugs
return $attrs;
}
+sub _sanitize_name {
+ my ($self, $name) = @_;
+
+ if (ref $name) {
+ # scalar ref for weird table name (like one containing a '.')
+ ($name = $$name) =~ s/\W+/_/g;
+ }
+ else {
+ # remove 'schema.' prefix if any
+ $name =~ s/^[^.]+\.//;
+ }
+
+ return $name;
+}
+
sub _normalize_name {
my ($self, $name) = @_;
+ $name = $self->_sanitize_name($name);
+
my @words = split_name $name;
return join '_', map lc, @words;
sub _normalize_name {
my ($self, $name) = @_;
+ $name = $self->_sanitize_name($name);
+
return lc $name;
}
regexes => {
'Result/Foo' => [
qr/^\Q__PACKAGE__->table("foo_schema.foo");\E/m,
+ # the has_many relname should not have the schema in it!
+ qr/^__PACKAGE__->has_many\(\n "bars"/m,
],
},
);