Sometimes, things Just Work.

jk2addict on 2006-11-13T18:57:05

It's the small things that make my day sometimes.

Somehow in my flurry of Handel 1.0 programming, I've missed the obvious: how to order the results of cart/item searches. [kudos to Kaare for pointing that out] So I thought to myself "just pass the search method \%options down through storage, and into DBIC resultset \%attributes. Sounds easy.

So, in my cart code, I just altered one line:

# my $results = $storage->search($filter);
my $results = $storage->search($filter, $opts);


What makes me happy is the fact that somewhere along the line, I made it a point to always just pass @_ (sans a shifted $self) ... so $storage->search passes it's @_ to DBIC->resultset->search...

Sames goes for things like $result->add_item(...), which passes it's @_ to $storage->add_item, which passed it's @_ to DBIC->resultset->create...

I'm sure that's obvious practice to some, but that forethought just saved me a lot of work. :-)