From: Michael G Schwern Date: Fri, 24 Oct 2008 02:54:25 +0000 (+0000) Subject: Using DBIx::Class as a parent causes Class::Accessor::Grouped to be X-Git-Tag: v0.08240~316 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5e85c6715197a71ec9bd016992e4e05ae90b14ce;p=dbsrgits%2FDBIx-Class.git Using DBIx::Class as a parent causes Class::Accessor::Grouped to be introduced to the hierarchy too early and thus CDBICompat::AccessorMapping's own mk_group_accessor() not get called. The only reason we're inheriting from DBIx::Class is to get mk_classdata(). Get it from Class::Data::Inheritable instead. mk_classdata() should be moved out of DBIx::Class into a role to avoid this problem. --- diff --git a/lib/DBIx/Class/CDBICompat/ColumnCase.pm b/lib/DBIx/Class/CDBICompat/ColumnCase.pm index a7c62a9..d6db87b 100644 --- a/lib/DBIx/Class/CDBICompat/ColumnCase.pm +++ b/lib/DBIx/Class/CDBICompat/ColumnCase.pm @@ -4,8 +4,6 @@ package # hide from PAUSE use strict; use warnings; -use base qw/DBIx::Class/; - sub _register_column_group { my ($class, $group, @cols) = @_; return $class->next::method($group => map lc, @cols); diff --git a/lib/DBIx/Class/CDBICompat/ImaDBI.pm b/lib/DBIx/Class/CDBICompat/ImaDBI.pm index 896eca7..7a3b4f0 100644 --- a/lib/DBIx/Class/CDBICompat/ImaDBI.pm +++ b/lib/DBIx/Class/CDBICompat/ImaDBI.pm @@ -6,7 +6,7 @@ use warnings; use DBIx::ContextualFetch; use Sub::Name (); -use base qw/DBIx::Class/; +use base qw(Class::Data::Inheritable); __PACKAGE__->mk_classdata('sql_transformer_class' => 'DBIx::Class::CDBICompat::SQLTransformer'); diff --git a/lib/DBIx/Class/CDBICompat/TempColumns.pm b/lib/DBIx/Class/CDBICompat/TempColumns.pm index 923e895..f5b60d4 100644 --- a/lib/DBIx/Class/CDBICompat/TempColumns.pm +++ b/lib/DBIx/Class/CDBICompat/TempColumns.pm @@ -3,7 +3,7 @@ package # hide from PAUSE use strict; use warnings; -use base qw/DBIx::Class/; +use base qw/Class::Data::Inheritable/; use Carp; diff --git a/t/cdbi-t/15-accessor.t b/t/cdbi-t/15-accessor.t index 99bcdbd..82f6310 100644 --- a/t/cdbi-t/15-accessor.t +++ b/t/cdbi-t/15-accessor.t @@ -41,7 +41,7 @@ sub Actor::accessor_name_for { return $col; } -# This is a class with accessor_name_for() but no corresponding mutatori_name_for() +# This is a class with accessor_name_for() but no corresponding mutator_name_for() sub Director::accessor_name_for { my($class, $col) = @_; return "nutty_as_a_fruitcake" if lc $col eq "isinsane";