X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FBase.pm;h=b4c995198b8488290b34c72bfe058efab776eba2;hb=1eea4fb1a3df18616870babdb74f04ecb8143d5c;hp=54cbf1214de57c8a83438e9913d76825d0d064a5;hpb=d70c335f958f95bc05df0b14f9d789ef9a0a37ff;p=dbsrgits%2FDBIx-Class-Schema-Loader.git 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)