Re: [Dbix-class] Re: Explicit class naming

2013-02-15 Thread Dag-Erling Smørgrav
Will Crawford  writes:
> Dagfinn Ilmari Mannsåker  writes:
> > Dag-Erling Smørgrav  writes:
> > > Is there a way to force the class name, perhaps by passing a hash
> > > to DBIx::Schema::Loader that maps the (case insensitive) table
> > > name to a (case sensitive) class name?
> > This is exactly what the moniker_map option is for:
> Do look at the inflect_{singular,plural} attributes too, if you're
> tweaking the result source names you may want to tweak some of the
> accessor / relation names as well.

Thank you both!

DES
-- 
Dag-Erling Smørgrav - d...@des.no

___
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk


Re: [Dbix-class] Re: Explicit class naming

2013-02-14 Thread Will Crawford
I've used moniker_map in a few places, but before I realised I could use
it, I named a table cached_v_a_t_numbers to get the same effect :)

Do look at the inflect_{singular,plural} attributes too, if you're tweaking
the result source names you may want to tweak some of the accessor /
relation names as well.



On 13 February 2013 17:45, Dagfinn Ilmari Mannsåker wrote:

> Dag-Erling Smørgrav  writes:
>
> > I have a sneaking suspicion that this is a FAQ, but I can't find the
> > answer anywhere.
> >
> > I have a schema where some of the table names are acronyms, and I'd like
> > dbicdump to create classes with all-caps names for those tables.  For
> > instance, I have a table named "mac", and I'd like the class to be named
> > MAC rather than Mac.  Is there a way to force the class name, perhaps by
> > passing a hash to DBIx::Schema::Loader that maps the (case insensitive)
> > table name to a (case sensitive) class name?
>
> This is exactly what the moniker_map option is for:
>
>  >
>
> --
> "The surreality of the universe tends towards a maximum" -- Skud's Law
> "Never formulate a law or axiom that you're not prepared to live with
>  the consequences of."  -- Skud's Meta-Law
>
>
> ___
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk
>
___
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk