From: Simon Cozens Date: Thu, 29 Jan 2004 14:10:16 +0000 (+0000) Subject: Tidy up the Beer database application a little X-Git-Tag: 2.10~347 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=8f41656be4b909d7aa4f680d9853fabea0146074;p=maypole.git Tidy up the Beer database application a little git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@15 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/BeerDB.pm b/lib/BeerDB.pm index afa303e..305aa80 100644 --- a/lib/BeerDB.pm +++ b/lib/BeerDB.pm @@ -3,14 +3,14 @@ package BeerDB; use Apache::MVC; use base 'Apache::MVC'; sub handler { Apache::MVC::handler("BeerDB", @_) } -use Class::DBI::Loader::Relationship; BeerDB->set_database("dbi:mysql:beerdb"); BeerDB->config->{template_root} = "/opt/beer"; BeerDB->config->{uri_base} = "http://neo.trinity-house.org.uk/beerdb/"; -BeerDB::Brewery->columns(Stringify => qw/name/); - -BeerDB->config->{loader}->relationship( "a brewery produces beers" ); -BeerDB->config->{loader}->relationship( "a pub has beers on handpumps"); +use Class::DBI::Loader::Relationship; +BeerDB->config->{loader}->relationship($_) for ( + "a brewery produces beers", + "a beer has a style", + "a pub has beers on handpumps"); 1;