Skip to content

Instantly share code, notes, and snippets.

@plu
Created November 23, 2010 16:46
Show Gist options
  • Save plu/712080 to your computer and use it in GitHub Desktop.
Save plu/712080 to your computer and use it in GitHub Desktop.
package DAO::Example::Controller::Root;
use strict;
use warnings;
use parent 'Catalyst::Controller';
use Data::Dumper;
$Data::Dumper::Sortkeys = 1;
__PACKAGE__->config->{namespace} = '';
sub index : Path : Args(0) {
my ( $self, $c ) = @_;
unless ( -e $c->path_to('dao_example.db') ) {
$c->model('DB')->schema->deploy;
$c->model('DB')->schema->init;
}
$c->res->print('<pre>');
$c->res->print( Dumper $c->config );
$c->res->print( Dumper $c->model('DB')->resultset('Person')->active->hashref_array );
$c->res->print( Dumper $c->model('DB')->resultset('Person')->inactive->hashref_array );
$c->res->print( Dumper $c->model('DB')->resultset('Person')->by_username('plu')->prefetch_all->hashref_array );
$c->res->print('</pre>');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment