Add a carp when a relationship is being redefined and DBIC_TRACE is on.
tamias: Ronald J Kimball <rjk@tamias.net>
-teejay : Aaron Trevena <teejay@cpan.org>
+teejay: Aaron Trevena <teejay@cpan.org>
+
+timbunce: Tim Bunce <Tim.Bunce@pobox.com>
Todd Lipcon
}
my %rels = %{ $self->_relationships };
+ if ($rels{$rel} && $ENV{DBIC_TRACE}) {
+ # warning is useful e.g. for large Schema::Loader generated schemas where
+ # relationships have been added manually and then later generated by
+ # Schema::Loader.
+ carp "$rel relationship redefined";
+ }
$rels{$rel} = { class => $f_source_name,
source => $f_source_name,
cond => $cond,