X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FTrack.pm;h=b82545a25defa6a6aebd33b4ca6ca8b647546d69;hb=4a233f3019d2baa4bf2abee0c873c74d5cdf3a11;hp=a57fcb54b912bf3eba865ca25f52342ebe805a68;hpb=6fbef4a4db1f453046b0450c485c495d743030d5;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest/Schema/Track.pm b/t/lib/DBICTest/Schema/Track.pm index a57fcb5..b82545a 100644 --- a/t/lib/DBICTest/Schema/Track.pm +++ b/t/lib/DBICTest/Schema/Track.pm @@ -1,10 +1,17 @@ package # hide from PAUSE DBICTest::Schema::Track; +use warnings; +use strict; + use base qw/DBICTest::BaseResult/; use Carp qw/confess/; -__PACKAGE__->load_components(qw/InflateColumn::DateTime Ordered/); +__PACKAGE__->load_components(qw{ + +DBICTest::DeployComponent + InflateColumn::DateTime + Ordered +}); __PACKAGE__->table('track'); __PACKAGE__->add_columns( @@ -65,8 +72,8 @@ __PACKAGE__->belongs_to( { join_type => 'left' }, ); -__PACKAGE__->might_have ( - next_track => __PACKAGE__, +__PACKAGE__->has_many ( + next_tracks => __PACKAGE__, sub { my $args = shift; @@ -83,11 +90,20 @@ __PACKAGE__->might_have ( "$args->{foreign_alias}.position" => { '>' => { -ident => "$args->{self_alias}.position" } }, }, $args->{self_rowobj} && { - "$args->{foreign_alias}.cd" => $args->{self_rowobj}->cd, - "$args->{foreign_alias}.position" => { '>' => $args->{self_rowobj}->position }, + "$args->{foreign_alias}.cd" => $args->{self_rowobj}->get_column('cd'), + "$args->{foreign_alias}.position" => { '>' => $args->{self_rowobj}->pos }, } ) } ); +our $hook_cb; + +sub sqlt_deploy_hook { + my $class = shift; + + $hook_cb->($class, @_) if $hook_cb; + $class->next::method(@_) if $class->next::can; +} + 1;