From: Peter Rabbitson Date: Tue, 12 May 2009 07:54:37 +0000 (+0000) Subject: Rename m2m warn disable envvar X-Git-Tag: v0.08103~97 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b7d1831a079d9b463231d8bbc764b8f628bfbec7;p=dbsrgits%2FDBIx-Class.git Rename m2m warn disable envvar --- diff --git a/lib/DBIx/Class/Relationship/ManyToMany.pm b/lib/DBIx/Class/Relationship/ManyToMany.pm index f06b9d5..06c862d 100644 --- a/lib/DBIx/Class/Relationship/ManyToMany.pm +++ b/lib/DBIx/Class/Relationship/ManyToMany.pm @@ -29,7 +29,7 @@ sub many_to_many { for ($add_meth, $remove_meth, $set_meth, $rs_meth) { if ( $class->can ($_) ) { - carp (<<"EOW") unless $ENV{DBIC_METHOD_CLOBBER_OK}; + carp (<<"EOW") unless $ENV{DBIC_OVERWRITE_HELPER_METHODS_OK}; *************************************************************************** The many-to-many relationship '$meth' is trying to create a utility method @@ -41,8 +41,8 @@ You almost certainly want to rename your method or the many-to-many relationship, as the functionality of the original method will not be accessible anymore. -To disable this warning set the environment variable DBIC_METHOD_CLOBBER_OK -to a true value +To disable this warning set to a true value the environment variable +DBIC_OVERWRITE_HELPER_METHODS_OK *************************************************************************** EOW diff --git a/t/103many_to_many_warning.t b/t/103many_to_many_warning.t index 06ac61e..37a0472 100644 --- a/t/103many_to_many_warning.t +++ b/t/103many_to_many_warning.t @@ -16,7 +16,7 @@ my $exp_warn = qr/The many-to-many relationship 'bars' is trying to create/; ok (! $@, 'Eval code without warnings suppression') || diag $@; - ok (@w, "Warning triggered without DBIC_METHOD_CLOBBER_OK"); + ok (@w, "Warning triggered without DBIC_OVERWRITE_HELPER_METHODS_OK"); } { @@ -25,12 +25,12 @@ my $exp_warn = qr/The many-to-many relationship 'bars' is trying to create/; my $code = gen_code ( suffix => 2 ); - local $ENV{DBIC_METHOD_CLOBBER_OK} = 1; + local $ENV{DBIC_OVERWRITE_HELPER_METHODS_OK} = 1; eval "$code"; ok (! $@, 'Eval code with warnings suppression') || diag $@; - ok (! @w, "No warning triggered with DBIC_METHOD_CLOBBER_OK"); + ok (! @w, "No warning triggered with DBIC_OVERWRITE_HELPER_METHODS_OK"); } sub gen_code {