X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FCDBICompat%2FColumnGroups.pm;h=44a60107b7e0bf194488f06145d1fb2dc688cef0;hb=1e0233457be7f60bc0a35a4913eecd7f7b7b15e8;hp=f4c8ac80a94044860cfd48a49a72d04c58733f8d;hpb=1c30a2e4a2907330fa59e4ab38a6b56e74136737;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/CDBICompat/ColumnGroups.pm b/lib/DBIx/Class/CDBICompat/ColumnGroups.pm index f4c8ac8..44a6010 100644 --- a/lib/DBIx/Class/CDBICompat/ColumnGroups.pm +++ b/lib/DBIx/Class/CDBICompat/ColumnGroups.pm @@ -83,7 +83,23 @@ sub _register_column_group { no strict 'refs'; my $existing_accessor = *{$class .'::'. $name}{CODE}; - return $existing_accessor && !$our_accessors{$existing_accessor}; + + return( + defined $existing_accessor + and + ! $our_accessors{$existing_accessor} + and + # under 5.8 mro the CODE slot may simply be a "cached method" + ! ( + DBIx::Class::_ENV_::OLD_MRO + and + grep { + $_ ne $class + and + ($_->can($name)||0) == $existing_accessor + } @{mro::get_linear_isa($class)} + ) + ) } sub _deploy_accessor {