Rose::DB::Object::Loader question on preserving customizations

29 views
Skip to first unread message

ty

unread,
Apr 24, 2012, 7:58:41 AM4/24/12
to Rose::DB::Object
Is there a way to call the make_modules and have them update existing
modules that were generated in the same way that
DBIx::Class::Schema::Loader does. The files it generates has this
section at the end where you can put your custom code

# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-14
09:09:03
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hPo79W4kBR++oNcSbMIp6g


# You can replace this text with custom code or comments, and it will
be preserv
ed on regeneration
1;


Best regards,

Ty

John Siracusa

unread,
Apr 24, 2012, 9:13:00 AM4/24/12
to rose-db...@googlegroups.com

There's nothing like that, but one way I've seen the same thing done
is to add a module_postamble that adds a line like:

require My::Whatever::Extra;

to the My::Whatever class, then put all your customization inside
My/Whatever/Extra.pm. That way, you can regenerate all the
non-"Extra" .pm files without overwriting your customizations.

-John

ty

unread,
Apr 24, 2012, 11:21:57 AM4/24/12
to Rose::DB::Object
Thanks John, I will give this a try.
Reply all
Reply to author
Forward
0 new messages