From: zby Date: Wed, 28 Jan 2009 15:09:23 +0000 (+0000) Subject: added Viewing.pm X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=8f52fe2b86500fd58ed9f63572765c6f9314bcc5;p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate added Viewing.pm --- diff --git a/t/lib/DBSchema/Result/Viewing.pm b/t/lib/DBSchema/Result/Viewing.pm new file mode 100755 index 0000000..13dcaa0 --- /dev/null +++ b/t/lib/DBSchema/Result/Viewing.pm @@ -0,0 +1,23 @@ +package DBSchema::Result::Viewing; +use base 'DBIx::Class::Core'; + +__PACKAGE__->table('viewing'); +__PACKAGE__->add_columns( + 'user_id' => { data_type => 'integer' }, + 'dvd_id' => { data_type => 'integer' }, +); +__PACKAGE__->set_primary_key(qw/user_id dvd_id/); + +__PACKAGE__->belongs_to( + user => 'DBSchema::Result::User', + {'foreign.id'=>'self.user_id'}, +); + +__PACKAGE__->belongs_to( + dvd => 'DBSchema::Result::Dvd', + {'foreign.id'=>'self.dvd_id'}, +); + +; + +1;