root/trunk/t/lib/partitioned/Recipe.pm @ 64

Revision 64, 0.6 kB (checked in by sky, 4 years ago)

r67@crucially-3 (orig r995): btrott | 2005-10-11 13:37:08 -0700
Removed username

  • Property svn:keywords set to Id Revision
Line 
1# $Id$
2
3package Recipe;
4use strict;
5use base qw( Data::ObjectDriver::BaseObject );
6
7use Data::ObjectDriver::Driver::DBI;
8
9__PACKAGE__->install_properties({
10    columns => [ 'id', 'cluster_id', 'title' ],
11    datasource => 'recipes',
12    primary_key => 'id',
13    driver => Data::ObjectDriver::Driver::DBI->new(
14        dsn      => 'dbi:SQLite:dbname=global.db',
15    ),
16});
17
18sub insert {
19    my $obj = shift;
20    ## Choose a cluster for this recipe. This isn't a very solid way of
21    ## doing this, but it works for testing.
22    $obj->cluster_id(int(rand 2) + 1);
23    $obj->SUPER::insert(@_);
24}
25
261;
Note: See TracBrowser for help on using the browser.