Revision history for DBIx::Class
+ - add default_resultset_attributes entry to Schema
- optimisation in DBI::Cursor to check software_limit before falling
back to base Cursor->all
- fix bug with create_multi not inserting non-storage objects
) if scalar @_;
return $self->resultset_class->new(
- $self, $self->{resultset_attributes}
+ $self,
+ {
+ %{$self->{resultset_attributes}},
+ %{$self->schema->default_resultset_attributes}
+ },
);
}
__PACKAGE__->mk_classdata('storage');
__PACKAGE__->mk_classdata('exception_action');
__PACKAGE__->mk_classdata('stacktrace' => $ENV{DBIC_TRACE} || 0);
+__PACKAGE__->mk_classdata('default_resultset_attributes' => {});
=head1 NAME
use strict;
use warnings;
-use Test::More;
+use Test::More qw(no_plan);
use lib qw(t/lib);
use DBICTest;
my $schema = DBICTest->init_schema();
-plan tests => 13;
-
# first page
my $it = $schema->resultset("CD")->search(
{},
)->search( undef, { order_by => 'title' } );
is( $it->count, 2, "chained searches paging ok" );
+
+my $p = sub { $schema->resultset("CD")->page(1)->pager->entries_per_page; };
+
+is($p->(), 10, 'default rows is 10');
+
+$schema->default_resultset_attributes({ rows => 5 });
+
+is($p->(), 5, 'default rows is 5');