From: Tim Bunce Date: Thu, 26 Mar 2009 12:46:16 +0000 (+0000) Subject: Move _get_custom_content call close to where it's used. X-Git-Tag: 0.04999_07~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1eea4fb1a3df18616870babdb74f04ecb8143d5c;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Move _get_custom_content call close to where it's used. --- diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 54cbf12..b4c9951 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -531,12 +531,6 @@ sub _write_classfile { unlink($filename); } - my $custom_content = $self->_get_custom_content($class, $filename); - - $custom_content ||= qq|\n\n# You can replace this text with custom| - . qq| content, and it will be preserved on regeneration| - . qq|\n1;\n|; - $text .= qq|$_\n| for @{$self->{_dump_storage}->{$class} || []}; @@ -555,6 +549,13 @@ sub _write_classfile { print $fh qq|$_\n| for @{$self->{_ext_storage}->{$class} || []}; + # Write out any custom content the user has added + my $custom_content = $self->_get_custom_content($class, $filename); + + $custom_content ||= qq|\n\n# You can replace this text with custom| + . qq| content, and it will be preserved on regeneration| + . qq|\n1;\n|; + print $fh $custom_content; close($fh)