From: Peter Rabbitson Date: Tue, 27 Sep 2016 13:17:00 +0000 (+0200) Subject: Remove the only use of the CAG 'inherited_ro_instance' group X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d2308dde5718dc0f828584c3fa24d7417c484040;p=dbsrgits%2FDBIx-Class.git Remove the only use of the CAG 'inherited_ro_instance' group Introduced for reasons unknown back in 93405cf0, it is currently nothing but baggage - especially given the lack of name synchronization as described in one of the comments in 28ef9468 grep.cpan.me indicates no use in the wild, so just kill it with fire --- diff --git a/lib/DBIx/Class/AccessorGroup.pm b/lib/DBIx/Class/AccessorGroup.pm index d4493e2..31cdcb0 100644 --- a/lib/DBIx/Class/AccessorGroup.pm +++ b/lib/DBIx/Class/AccessorGroup.pm @@ -63,6 +63,11 @@ sub mk_group_accessors { } } } + elsif( $type eq 'inherited_ro_instance' ) { + DBIx::Class::Exception->throw( + "The 'inherted_ro_instance' CAG group has been retired - use 'inherited' instead" + ); + } } sub get_component_class { diff --git a/lib/DBIx/Class/ResultSourceProxy.pm b/lib/DBIx/Class/ResultSourceProxy.pm index 7a6ab9d..0032a0a 100644 --- a/lib/DBIx/Class/ResultSourceProxy.pm +++ b/lib/DBIx/Class/ResultSourceProxy.pm @@ -25,15 +25,25 @@ use namespace::clean; # instance, and there is *ZERO EFFORT* made to synchronize them... # FIXME: Due to the above marking this as a rsrc_proxy method is also out # of the question... -__PACKAGE__->mk_group_accessors('inherited_ro_instance' => 'source_name'); - -sub get_inherited_ro_instance { $_[0]->get_inherited($_[1]) } - -sub set_inherited_ro_instance { - $_[0]->throw_exception ("Cannot set '$_[1]' on an instance") - if length ref $_[0]; - - $_[0]->set_inherited( $_[1], $_[2] ); +# FIXME: this used to be a sub-type of inherited ( to see run: +# `git log -Sinherited_ro_instance lib/DBIx/Class/ResultSourceProxy.pm` ) +# however given the lack of any sync effort as described above *anyway*, +# it makes no sense to guard for erroneous use at a non-trivial cost in +# performance (and may end up in the way of future optimizations as per +# https://github.com/vovkasm/Class-Accessor-Inherited-XS/issues/2#issuecomment-243246924 ) +__PACKAGE__->mk_group_accessors( inherited => 'source_name'); + +# The marking with indirect_sugar will cause warnings to be issued in darkpan code +# (though extremely unlikely) +sub get_inherited_ro_instance :DBIC_method_is_indirect_sugar { + DBIx::Class::Exception->throw( + "The 'inherted_ro_instance' CAG group has been retired - use 'inherited' instead" + ); +} +sub set_inherited_ro_instance :DBIC_method_is_indirect_sugar { + DBIx::Class::Exception->throw( + "The 'inherted_ro_instance' CAG group has been retired - use 'inherited' instead" + ); } sub add_columns :DBIC_method_is_bypassable_resultsource_proxy { diff --git a/lib/DBIx/Class/ResultSourceProxy/Table.pm b/lib/DBIx/Class/ResultSourceProxy/Table.pm index b0c4343..4cb733f 100644 --- a/lib/DBIx/Class/ResultSourceProxy/Table.pm +++ b/lib/DBIx/Class/ResultSourceProxy/Table.pm @@ -9,7 +9,6 @@ use DBIx::Class::ResultSource::Table; use Scalar::Util 'blessed'; use namespace::clean; -# FIXME - both of these *PROBABLY* need to be 'inherited_ro_instance' type __PACKAGE__->mk_classaccessor(table_class => 'DBIx::Class::ResultSource::Table'); # FIXME: Doesn't actually do anything yet! __PACKAGE__->mk_group_accessors( inherited => 'table_alias' );