<p>When using -&gt;pager-&gt;count on complicated resultset this error pops up:<br>
<code><br>
Single parameters to new() must be a HASH ref at /usr/lib64/perl5/site_perl/5.12.3/x86_64-linux/Moose/Object.pm line 30<br>
        Moose::Object::BUILDARGS('PODirect::Schema::ResultSet::user', 'DBIx::Class::ResultSource::Table=HASH(0x9d5e0f0)') called at /usr/lib64/perl5/site_perl/5.12.3/MooseX/NonMoose/Meta/Role/Class.pm line 154<br>
        MySchema::Schema::ResultSet::user::new('PODirect::Schema::ResultSet::user', 'DBIx::Class::ResultSource::Table=HASH(0x9d5e0f0)') called at /usr/lib64/perl5/site_perl/5.12.3/DBIx/Class/ResultSet.pm line 3389<br>
        DBIx::Class::ResultSet::as_subselect_rs('PODirect::Schema::ResultSet::user=HASH(0x7f32b0acac30)') called at /usr/lib64/perl5/site_perl/5.12.3/DBIx/Class/ResultSet.pm line 1766<br>
        DBIx::Class::ResultSet::_count_subq_rs('PODirect::Schema::ResultSet::user=HASH(0x7f32b0abf518)', 'HASH(0x7f32b0acc820)') called at /usr/lib64/perl5/site_perl/5.12.3/DBIx/Class/ResultSet.pm line 1604                                                                                                                                                <br>
        DBIx::Class::ResultSet::count('PODirect::Schema::ResultSet::user=HASH(0x7f32b0abf518)') called at /usr/lib64/perl5/site_perl/5.12.3/DBIx/Class/ResultSet.pm line 2536  <br>
        DBIx::Class::ResultSet::__ANON__ at /usr/lib64/perl5/site_perl/5.12.3/DBIx/Class/ResultSet/Pager.pm line 15                                                            <br>
        DBIx::Class::ResultSet::Pager::_total_entries_accessor('DBIx::Class::ResultSet::Pager=HASH(0x7f32b0acc178)') called at /usr/lib64/perl5/vendor_perl/5.12.3/Data/Page.pm line 50                                                                                                                                                                       <br>
        Data::Page::total_entries('DBIx::Class::ResultSet::Pager=HASH(0x7f32b0acc178)') called at test.pl line 85<br>
</code></p>

<p>Sample code:<br>
<code><br>
my $s = $ex-&gt;search_rs({<br>
       "category.category" =&gt; 'test'<br>
}, {<br>
          'page' =&gt; 1,<br>
          'rows' =&gt; 10,<br>
          'prefetch' =&gt; [<br>
                          {<br>
                            'table1' =&gt; [<br>
                                                     {<br>
                                                       'table2' =&gt; []<br>
                                                     }<br>
                                                   ]<br>
                          }<br>
                        ],<br>
});<br>
</code></p>

<p>This small fix resolves the problem.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>&nbsp;&nbsp;<a href='https://github.com/dbsrgits/dbix-class/pull/105'>https://github.com/dbsrgits/dbix-class/pull/105</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>as_subselect_rs new resultset bugfix</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/dbsrgits/dbix-class/pull/105/files#diff-0">lib/DBIx/Class/ResultSet.pm</a>
    (3)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/dbsrgits/dbix-class/pull/105.patch'>https://github.com/dbsrgits/dbix-class/pull/105.patch</a></li>
  <li><a href='https://github.com/dbsrgits/dbix-class/pull/105.diff'>https://github.com/dbsrgits/dbix-class/pull/105.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/dbsrgits/dbix-class/pull/105">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AASeAmkIDAUhpNZVqso8SkZdIHfMn6Lcks5qGULqgaJpZM4IpPB_">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AASeAiohhBYYtOPGnn19QdW7OifLFTduks5qGULqgaJpZM4IpPB_.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/dbsrgits/dbix-class/pull/105"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>