From: Peter Rabbitson Date: Tue, 5 Mar 2013 06:01:33 +0000 (+0100) Subject: Move CDBI code out of the main ResultSet implementation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6ad439d45d83a4a1061ab7e4ab95af9e59cdd53b;p=dbsrgits%2FDBIx-Class-Historic.git Move CDBI code out of the main ResultSet implementation --- diff --git a/lib/DBIx/Class/CDBICompat/Iterator.pm b/lib/DBIx/Class/CDBICompat/Iterator.pm index 847b10b..eb60177 100644 --- a/lib/DBIx/Class/CDBICompat/Iterator.pm +++ b/lib/DBIx/Class/CDBICompat/Iterator.pm @@ -49,4 +49,16 @@ sub _bool { return $_[0]->count; } +sub _construct_results { + my $self = shift; + + my $rows = $self->next::method(@_); + + if (my $f = $self->_resolved_attrs->{record_filter}) { + $_ = $f->($_) for @$rows; + } + + return $rows; +} + 1; diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index fd9d593..f2ab80b 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1440,11 +1440,6 @@ sub _construct_results { $_ = $inflator_cref->($res_class, $rsrc, @$_) for @$rows; } - # CDBI compat stuff - if ($attrs->{record_filter}) { - $_ = $attrs->{record_filter}->($_) for @$rows; - } - return $rows; }