sub test_distinct :Local { $c->stash->{distinct_groups} = [ $c->model('Database1')->resultset('Table1')->search( undef, { select => [ { distinct => 'group' }, ], order_by => 'group' }, ) ]; }