Nuked _select_columns, the last vestige of class-based evil
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / LazyLoading.pm
index 6a33eff..8a7c17b 100644 (file)
@@ -3,8 +3,11 @@ package DBIx::Class::CDBICompat::LazyLoading;
 use strict;
 use warnings;
 
-sub _select_columns {
-  return shift->columns('Essential');
+sub resultset_instance {
+  my $self = shift;
+  my $rs = $self->next::method(@_);
+  $rs = $rs->search(undef, { cols => [ $self->columns('Essential') ] });
+  return $rs;
 }
 
 sub get_column {
@@ -15,7 +18,7 @@ sub get_column {
                            && $_ ne 'All' }
                    keys %{ $self->_column_groups || {} });
   }
-  $self->NEXT::get_column(@_[1..$#_]);
+  $self->next::method(@_[1..$#_]);
 }
 
 sub _flesh {
@@ -24,7 +27,8 @@ sub _flesh {
   my %want;
   $want{$_} = 1 for map { keys %{$self->_column_groups->{$_}} } @groups;
   if (my @want = grep { !exists $self->{'_column_data'}{$_} } keys %want) {
-    my $cursor = $self->storage->select($self->_table_name, \@want,
+    my $cursor = $self->result_source->storage->select(
+                $self->result_source->name, \@want,
                 \$self->_ident_cond, { bind => [ $self->_ident_values ] });
     #my $sth = $self->storage->select($self->_table_name, \@want,
     #                                   $self->ident_condition);