From: Simon Cozens Date: Sat, 24 Jan 2004 16:13:59 +0000 (+0000) Subject: That's a bit easier to read, isn't it? X-Git-Tag: 2.10~352 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=131e374a3433ce84f66ef69abefc45080d6d2dc0;p=maypole.git That's a bit easier to read, isn't it? git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@10 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/BeerDB.pm b/lib/BeerDB.pm index 56ecebe..c69e2dc 100644 --- a/lib/BeerDB.pm +++ b/lib/BeerDB.pm @@ -5,12 +5,9 @@ use base 'Apache::MVC'; sub handler { Apache::MVC::handler("BeerDB", @_) } BeerDB->set_database("dbi:SQLite:dbname=/opt/beer/beerdb.db"); BeerDB->config->{template_root} = "/opt/beer"; - BeerDB::Brewery->columns(Stringify => qw/name/); -BeerDB::Brewery->has_many(beers => "BeerDB::Beer"); -BeerDB::Beer->has_a(brewery => "BeerDB::Brewery"); -BeerDB::Handpump->has_a(beer => "BeerDB::Beer"); -BeerDB::Handpump->has_a(pub => "BeerDB::Pub"); -BeerDB::Pub->has_many(beers => [ BeerDB::Handpump => 'beer' ]); -BeerDB::Beer->has_many(pubs => [ BeerDB::Handpump => 'pub' ]); +BeerDB->config->{loader}->relationship( "a brewery produces beers" ); +BeerDB->config->{loader}->relationship( "a pub has beers on handpumps"); + +1;