From: Peter Rabbitson Date: Wed, 27 Oct 2010 10:11:15 +0000 (+0200) Subject: Automatically mark the cap. framework methods as unimplemented for replication X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7f4433eb9bbe0650b4f5e2dff8bf817f4d28d3df;p=dbsrgits%2FDBIx-Class-Historic.git Automatically mark the cap. framework methods as unimplemented for replication --- diff --git a/lib/DBIx/Class/Storage/DBI/Replicated.pm b/lib/DBIx/Class/Storage/DBI/Replicated.pm index 17936a7..7fff40e 100644 --- a/lib/DBIx/Class/Storage/DBI/Replicated.pm +++ b/lib/DBIx/Class/Storage/DBI/Replicated.pm @@ -376,25 +376,20 @@ my @unimplemented = qw( set_use_dbms_capability get_dbms_capability set_dbms_capability - - sql_limit_dialect - _dbh_details - _use_insert_returning - _supports_insert_returning - - _use_placeholders - _supports_placeholders - _determine_supports_placeholders - - _use_typeless_placeholders - _supports_typeless_placeholders - _determine_supports_typeless_placeholders + sql_limit_dialect _inner_join_to_node ); +# the capability framework +# not sure if CMOP->initialize does evil things to DBIC::S::DBI, fix if a problem +push @unimplemented, ( grep + { $_ =~ /^ _ (?: use | supports | determine_supports ) _ /x } + ( Class::MOP::Class->initialize('DBIx::Class::Storage::DBI')->get_all_method_names ) +); + for my $method (@unimplemented) { __PACKAGE__->meta->add_method($method, sub { croak "$method must not be called on ".(blessed shift).' objects';