From: Michael G Schwern Date: Fri, 14 Mar 2008 01:50:05 +0000 (+0000) Subject: Move code having to do with adding columns out of ColumnCase. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c0eb27e8608791775aff1a8d35fe14b4abf011b0;p=dbsrgits%2FDBIx-Class-Historic.git Move code having to do with adding columns out of ColumnCase. --- diff --git a/lib/DBIx/Class/CDBICompat/ColumnCase.pm b/lib/DBIx/Class/CDBICompat/ColumnCase.pm index c1a1cd3..410fded 100644 --- a/lib/DBIx/Class/CDBICompat/ColumnCase.pm +++ b/lib/DBIx/Class/CDBICompat/ColumnCase.pm @@ -13,8 +13,7 @@ sub _register_column_group { sub add_columns { my ($class, @cols) = @_; - $class->mk_group_accessors(column => @cols); - $class->result_source_instance->add_columns(map lc, @cols); + return $class->result_source_instance->add_columns(map lc, @cols); } sub has_a { diff --git a/lib/DBIx/Class/CDBICompat/ColumnGroups.pm b/lib/DBIx/Class/CDBICompat/ColumnGroups.pm index fa87ac1..6efd725 100644 --- a/lib/DBIx/Class/CDBICompat/ColumnGroups.pm +++ b/lib/DBIx/Class/CDBICompat/ColumnGroups.pm @@ -24,10 +24,16 @@ sub columns { sub _add_column_group { my ($class, $group, @cols) = @_; + $class->mk_group_accessors(column => @cols); $class->add_columns(@cols); $class->_register_column_group($group => @cols); } +sub add_columns { + my ($class, @cols) = @_; + $class->result_source_instance->add_columns(@cols); +} + sub _register_column_group { my ($class, $group, @cols) = @_;