<sheepish>
Sorry! It looks like I just had my arguments in the wrong order:
perl script/app_create.pl model App DBIC::Schema \
App::Schema create=static \
components=EncodedColumn \
AutoCommit=1 \
moniker_map='{ plant_species => "PlantSpecies" }' \
dbi:mysql:antspec 'username' 'password'
does the trick. Thanks for the replies.
</sheepish>
From: matthew couchman (JIC) [mailto:[email protected]]
Sent: 05 May 2011 14:34
To: The elegant MVC web framework
Subject: RE: [Catalyst] moniker_map arg in app_create.pl
Hi again,
To clarify: app_create.pl correctly creates Species.pm when it encounters a
table called species but is confused when it encounters any preceding string in
the table name (e.g. plant_species) and attempts to singularise it (e.g.
PlantSpecy.pm).
This is the command I use to create the model:
perl script/app_create.pl model App DBIC::Schema \
App::Schema create=static dbi:mysql:app_db 'username' 'password' \
AutoCommit=1 \
moniker_map='{ plant_species => "PlantSpecies" }' \
components=EncodedColumn
Is the syntax correct? Would 'inflect_plural' be a more suitable argument? If
anyone could give some examples of how to use
moniker_map/inflect_plural/another on the command line that would be really
useful.
Thanks very much,
Matt.
From: Lee [mailto:[email protected]]
Sent: 04 May 2011 19:02
To: The elegant MVC web framework
Subject: Re: [Catalyst] moniker_map arg in app_create.pl
What plural should he use?
On 04/05/2011 18:37, Hernan Lopes wrote:
you should name your model singular, not plural
On Wed, May 4, 2011 at 1:31 PM, matthew couchman (JIC)
<[email protected]<mailto:[email protected]>> wrote:
Hi,
I have a table called plant_species which by default creates a schema result
class PlantSpecy when I run my app_create.pl<http://app_create.pl> script. To
get around this I've tried passing moniker_map='{ plant_species =>
"PlantSpecies" }' as an extra argument. It looks like the argument is read
because it appears in lib/App/Model/App.pm but I still have a PlantSpecy.pm
file rather than PlantSpecies.pm.
Can anyone help?
Thanks very much,
Matt.
_______________________________________________
List: [email protected]<mailto:[email protected]>
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/
_______________________________________________
List: [email protected]<mailto:[email protected]>
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/