From: Devin Austin Date: Tue, 5 Apr 2011 22:32:49 +0000 (-0600) Subject: updated with AFTER_APPLY X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=74b3dafe952a34c447f639560f71a8f858947f01;p=dbsrgits%2FDBIx-Class.git updated with AFTER_APPLY --- diff --git a/lib/DBIx/Class/Ordered.pm b/lib/DBIx/Class/Ordered.pm index 2ee65c5..eb79460 100644 --- a/lib/DBIx/Class/Ordered.pm +++ b/lib/DBIx/Class/Ordered.pm @@ -2,6 +2,7 @@ package DBIx::Class::Ordered; use strict; use warnings; use base qw( DBIx::Class ); +use Class::C3::Componentised::LoadActions; =head1 NAME @@ -97,6 +98,8 @@ move a record it always causes other records in the list to be updated. =head1 METHODS + + =head2 position_column __PACKAGE__->position_column('position'); @@ -108,6 +111,9 @@ positional value of each record. Defaults to "position". __PACKAGE__->mk_classdata( 'position_column' => 'position' ); +## this is private +AFTER_APPLY { $_[0]->result_source_instance->inject_resultset_components(['+DBIx::Class::Ordered::ResultSet']) }; + =head2 grouping_column __PACKAGE__->grouping_column('group_id'); @@ -972,22 +978,6 @@ sub _ordered_internal_update { return $self->update(@_); } -=head2 table - -Overridden to provide a resultset class to override delete and update methods. - -Shamelessly stolen from InflateColumn::FS - -=cut - -sub table { - my $self = shift; - warn "**INSIDE Ordered->table**"; - my $ret = $self->next::method(@_); - $self->result_source_instance->resultset_class( - 'DBIx::Class::Ordered::ResultSet'); - return $ret; -} 1; diff --git a/t/ordered/inject_component_update.t b/t/ordered/inject_component_update.t index 1bc11f3..a060423 100644 --- a/t/ordered/inject_component_update.t +++ b/t/ordered/inject_component_update.t @@ -3,6 +3,7 @@ use warnings; use Test::More; use Test::Exception; use lib qw(t/lib); +use Data::Dumper; use DBICTest; # do not remove even though it is not used #15:01 <@ribasushi> dhoss: you are complicating your life @@ -34,12 +35,13 @@ my $cd = $schema->resultset('CD')->create( lives_ok( sub { $cd->delete }, "Cascade delete on ordered has_many doesn't bomb" ); - is_deeply( mro::get_linear_isa( ref $schema->resultset("Track") ), [ qw( + DBICTest::BaseResultSet::+::_DBIx_Class_Ordered_ResultSet DBIx::Class::Ordered::ResultSet + DBICTest::BaseResultSet DBIx::Class::ResultSet DBIx::Class DBIx::Class::Componentised