[Dbix-class] Caching total_entires in the Pager -- how can build
a good cache key?
Bill Moseley
moseley at hank.org
Fri Aug 9 19:24:39 GMT 2013
On Fri, Aug 9, 2013 at 10:44 AM, Peter Rabbitson <rabbit+dbic at rabbit.us>wro=
te:
>
> > (In my case I don't have $orig_unpaged_rs as I'm using a role to apply
> > paging to all the actions that work on collections -- so I'd still have
> to
> > "strip" the $rs->{attrs} as in my original, which is a bit dirty.)
>
> Not only dirty but guaranteed to break in the future - {attrs} will
> eventually disappear. If you can have the role preserve the "clean" rs -
> do that, it will save you a lot of headache down the road.
>
Ok. In my case I don't have $orig_unpaged_rs -- I'm passed an $rs. Could
we have a method to replace the {attrs} hacking? Something like this?
my $count_rs =3D $rs->unpaged_rs->unsorted_rs->count_rs;
>
> Cheers
>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
>
-- =
Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20130809/f3f=
16bb5/attachment.htm
More information about the DBIx-Class
mailing list