From: Brian O'Connor Date: Thu, 15 Jan 2004 20:49:30 +0000 (+0000) Subject: Added a method based to the template to correctly reformat module names to include... X-Git-Tag: v0.06~237 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=43167a3159baf7f1eab428c172c24871d1aec977;p=dbsrgits%2FSQL-Translator.git Added a method based to the template to correctly reformat module names to include cap chars after a '_' in the Turnkey producer embedded templates. --- diff --git a/lib/SQL/Translator/Producer/Turnkey.pm b/lib/SQL/Translator/Producer/Turnkey.pm index 5024a82..d104013 100644 --- a/lib/SQL/Translator/Producer/Turnkey.pm +++ b/lib/SQL/Translator/Producer/Turnkey.pm @@ -1,7 +1,7 @@ package SQL::Translator::Producer::Turnkey; # ------------------------------------------------------------------- -# $Id: Turnkey.pm,v 1.20 2004-01-15 20:40:15 boconnor Exp $ +# $Id: Turnkey.pm,v 1.21 2004-01-15 20:49:30 boconnor Exp $ # ------------------------------------------------------------------- # Copyright (C) 2003 Allen Day , # Brian O'Connor . @@ -23,7 +23,7 @@ package SQL::Translator::Producer::Turnkey; use strict; use vars qw[ $VERSION $DEBUG ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.20 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.21 $ =~ /(\d+)\.(\d+)/; $DEBUG = 1 unless defined $DEBUG; use SQL::Translator::Schema::Constants; @@ -59,7 +59,7 @@ sub produce { my %meta = ( format_fk => $t->format_fk_name, format_package => $t->format_package_name, - format_module => $t->format_module_name, + format_table => $t->format_table_name, template => $args->{'template'} || '', baseclass => $baseclass, db_dsn => $args->{'db_dsn'} || '', @@ -464,7 +464,7 @@ EOF [% FOREACH node = nodes %] [% IF !node.value.is_trivial_link %] - + [%- END -%] [% END %] @@ -473,12 +473,12 @@ EOF [% FOREACH focus_atom = nodes %] [% IF !focus_atom.value.is_trivial_link %] [% FOREACH link_atom = focus_atom.value.hyperedges %] - + [%- END -%] [% previous = "" %] [% FOREACH link_atom = focus_atom.value.edges %] [% IF link_atom.type == 'export' && previous != link_atom.thatnode.table.name && link_atom.thatnode.table.name != "" %] - + [% previous = link_atom.thatnode.table.name %] [% END %] [%- END %] @@ -489,18 +489,18 @@ EOF [% FOREACH focus_atom = nodes %] [% IF !focus_atom.value.is_trivial_link %] - + [% FOREACH link_atom = focus_atom.value.hyperedges %] - + [%- END%] [% previous = "" %] [% FOREACH link_atom = focus_atom.value.edges %] [% IF link_atom.type == 'export' && previous != link_atom.thatnode.table.name %] - + [% previous = link_atom.thatnode.table.name %] [% END %] [%- END %] - + [%- END %] [% END %] @@ -513,7 +513,7 @@ EOF [% FOREACH focus_atom = nodes %] [% IF !focus_atom.value.is_trivial_link %] - + [%- END -%] [% END %] @@ -590,8 +590,8 @@ EOF [% MACRO renderatom(atom, dbobject) SWITCH atom.name %] [- FOREACH node = nodes -] [- IF !node.value.is_trivial_link -] - [% CASE '[- format_module(node.key) -]' %] - [% render[- format_module(node.key) -]Atom(atom,dbobject) %] + [% CASE '[- format_table(node.key) -]' %] + [% render[- format_table(node.key) -]Atom(atom,dbobject) %] [- END -] [- END -] [% CASE DEFAULT %] @@ -599,13 +599,13 @@ EOF [% END %] [- FOREACH node = nodes -] [- IF !node.value.is_trivial_link -] -[% MACRO render[- format_module(node.key) -]Atom(atom, dbobject) BLOCK %] +[% MACRO render[- format_table(node.key) -]Atom(atom, dbobject) BLOCK %] [% lstArr = atom.render(dbobject) %] [% rowcount = 0 %] [% IF atom.focus == "yes" %] [% FOREACH record = lstArr %] [% fields = record.data %] - [- pname = format_module(node.key) -] + [- pname = format_table(node.key) -] [- pkey = "Turnkey::Model::${pname}" -] [- FOREACH field = node.value.data_fields -] [- IF field != "1" -]