Amended category listing

This commit is contained in:
Finn 2018-03-26 14:42:18 +01:00
parent 4844174ead
commit 4b4d50de07
3 changed files with 36 additions and 22 deletions

View file

@ -0,0 +1,22 @@
package Pear::LocalLoop::Schema::ResultSet::Category;
use strict;
use warnings;
use base 'DBIx::Class::ResultSet';
sub as_hash {
my ( $self ) = @_;
my %category_list = (
(
map {
$_->id => $_->name,
} $self->all
),
0 => 'Uncategorised',
);
return \%category_list;
}
1;