From: Matt S Trout Date: Fri, 21 Aug 2009 19:12:47 +0000 (+0100) Subject: add add_additional_parents method X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4e4f71e3a8b42cf7b011620ea244891c943b12d5;p=dbsrgits%2FDBIx-Class-ResultSource-MultipleTableInheritance.git add add_additional_parents method --- diff --git a/lib/DBIx/Class/ResultSource/MultipleTableInheritance.pm b/lib/DBIx/Class/ResultSource/MultipleTableInheritance.pm index 6ff01e3..f05b19b 100644 --- a/lib/DBIx/Class/ResultSource/MultipleTableInheritance.pm +++ b/lib/DBIx/Class/ResultSource/MultipleTableInheritance.pm @@ -41,6 +41,15 @@ method new ($class: @args) { return $new; } +method add_additional_parents (@classes) { + foreach my $class (@classes) { + Class::C3::Componentised->ensure_class_loaded($class); + $self->add_additional_parent( + $class->result_source_instance + ); + } +} + method add_additional_parent ($source) { my ($our_pk, $their_pk) = map { join('|',sort $_->primary_columns)