From: Robert Bohne Date: Mon, 15 Feb 2010 12:25:11 +0000 (+0100) Subject: Add custom_column_info implemenation X-Git-Tag: 0.05003~5^2~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b639d969ac17b55b76ac57c1a90442f0e80ffffa;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Add custom_column_info implemenation --- diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 2956ca9..c74ec50 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -32,6 +32,7 @@ __PACKAGE__->mk_group_ro_accessors('simple', qw/ skip_relationships skip_load_external moniker_map + custom_column_info inflect_singular inflect_plural debug @@ -1523,6 +1524,16 @@ sub _quote_table_name { sub _is_case_sensitive { 0 } +sub _custom_column_info { + my ( $self, $info ) = @_; + + if( ref $self->custom_column_info eq 'HASH' ) { + + } elsif( ref $self->custom_column_info eq 'CODE' ) { + return $self->custom_column_info->($info); + } +} + # remove the dump dir from @INC on destruction sub DESTROY { my $self = shift; diff --git a/lib/DBIx/Class/Schema/Loader/DBI.pm b/lib/DBIx/Class/Schema/Loader/DBI.pm index ba314ee..0dd5c3f 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI.pm @@ -289,8 +289,8 @@ sub _columns_info_for { $col_name =~ s/^\"(.*)\"$/$1/; my $extra_info = $self->_extra_column_info($info) || {}; - - $result{$col_name} = { %column_info, %$extra_info }; + my $custom_info = $self->_custom_column_info($info) || {}; + $result{$col_name} = { %column_info, %$extra_info, %$custom_info }; } $sth->finish; };