use strict;
use warnings;
-use Try::Tiny;
+use DBIx::Class::_Util qw( dbic_internal_try dbic_internal_catch );
use namespace::clean;
our %_pod_inherit_config =
$class->throw_exception(
"No such column '$f_key' declared yet on ${class} ($guess)"
- ) unless $class->has_column($f_key);
+ ) unless $class->result_source->has_column($f_key);
$class->ensure_class_loaded($f_class);
- my $f_rsrc = try {
- $f_class->result_source_instance;
+ my $f_rsrc = dbic_internal_try {
+ $f_class->result_source;
}
- catch {
+ dbic_internal_catch {
$class->throw_exception(
"Foreign class '$f_class' does not seem to be a Result class "
- . "(or it simply did not load entirely due to a circular relation chain)"
+ . "(or it simply did not load entirely due to a circular relation chain): $_"
);
};
else {
if (ref $cond eq 'HASH') { # ARRAY is also valid
my $cond_rel;
+ # FIXME This loop is ridiculously incomplete and dangerous
+ # staving off changes until implmentation of the swindon consensus
for (keys %$cond) {
if (m/\./) { # Explicit join condition
$cond_rel = $cond;
and
(keys %$cond)[0] =~ /^foreign\./
and
- $class->has_column($rel)
+ $class->result_source->has_column($rel)
) ? 'filter' : 'single';
my $fk_columns = ($acc_type eq 'single' and ref $cond eq 'HASH')
return 1;
}
-# Attempt to remove the POD so it (maybe) falls off the indexer
-
-#=head1 AUTHORS
-#
-#Alexander Hartmaier <Alexander.Hartmaier@t-systems.at>
-#
-#Matt S. Trout <mst@shadowcatsystems.co.uk>
-#
-#=cut
-
1;