File tree 1 file changed +12
-1
lines changed
lib/DBIx/Class/Schema/Loader
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ __PACKAGE__->mk_group_ro_accessors('simple', qw/
88
88
allow_extra_m2m_cols
89
89
/ );
90
90
91
-
91
+
92
92
__PACKAGE__ -> mk_group_accessors(' simple' , qw/
93
93
version_to_dump
94
94
schema_version_to_dump
@@ -614,6 +614,17 @@ a coderef for a translator function taking a L<table
614
614
object|DBIx::Class::Schema::Loader::Table> argument (which stringifies to the
615
615
unqualified table name) and returning a scalar moniker
616
616
617
+ For Example:
618
+
619
+ Some databases like to prefix a namespace to every table definition
620
+ (e.g. Microsoft SQL Server likes to add 'dbo'). To avoid having your classes
621
+ contain redundant information you can pass C<moniker_map > a function to strip it off.
622
+
623
+ moniker_map => sub { my $name = $_[0];
624
+ $name =~ s/^dbo//;
625
+ join '', map ucfirst, split '_', $name
626
+ }
627
+
617
628
The function is also passed a coderef that can be called with either
618
629
of the hashref forms to get the moniker mapped accordingly. This is
619
630
useful if you need to handle some monikers specially, but want to use
You can’t perform that action at this time.
0 commit comments