add() alias to push() in Mp::Headers (wishlist 14142)
Fixed inheritance issues in Mp::Application - Mp::App now manipulates the caller's
@ISA directly, and doesn't inject itself into the chain (bugs 12923 & 14120)
+ Added new path processing methods for ssl and default table/action
Moved ar accessor to Apache::MVC (bug 14014)
+ Refactored core to support further development in 2.11 and onwards
+ Fixed related_class method (bug 14566)
2.10 Tue 19 Jul 2005
Multiple Template Paths added ( http://rt.cpan.org/NoAuth/Bug.html?id=13447 )
}
sub related_class {
- my ( $self, $r, $accessor ) = @_;
+ my ( $self, $r, $accessor ) = @_;
+ my $meta = $self->meta_info;
+ my @rels = keys %$meta;
+ my $related;
+ foreach (@rels) {
+ $related = $meta->{$_}{$accessor};
+ last if $related;
+ }
+ return unless $related;
+
+ my $mapping = $related->{args}->{mapping};
+ if ( $mapping and @$mapping ) {
+ return $related->{foreign_class}->meta_info('has_a')->{$$mapping[0]}->{foreign_class};
+ }
+ else {
+ return $related->{foreign_class};
+ }
+ }
- my $related = $self->meta_info( has_many => $accessor ) ||
- $self->meta_info( has_a => $accessor ) ||
- return;
-
- my $mapping = $related->{args}->{mapping} || [];
- if ( @$mapping ) {
- return $related->{foreign_class}->meta_info('has_a')->{ $$mapping[0] }
- ->{foreign_class};
- }
- else {
- return $related->{foreign_class};
- }
-}
sub do_edit : Exported {
my ( $self, $r ) = @_;