From: Robert Bohne Date: Mon, 15 Feb 2010 13:05:44 +0000 (+0100) Subject: Add POD for custom_column_info, remove ( empty ) hashref support from custom_column_info X-Git-Tag: 0.05003~5^2~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3a36870932af0d82658cfc77693fec5c478cdaf0;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Add POD for custom_column_info, remove ( empty ) hashref support from custom_column_info --- diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 9247e95..5cdd624 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -380,6 +380,23 @@ made to Loader-generated code. Again, you should be using version control on your schema classes. Be careful with this option. +=head2 custom_column_info + +Must be a coderef, returing a hashref with the custom column informations. + +Example: + + sub _custom_column_info { + my $info = shift; + + if ( $info->{TYPE_NAME} eq 'DATE' ){ + return { timezone => "Europe/Berlin" }; + } + return; + } + +Add to all columns with type DATE the attribute timezone => "Europe/Berlin". + =head1 METHODS None of these methods are intended for direct invocation by regular @@ -1563,11 +1580,10 @@ 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' ) { + if( ref $self->custom_column_info eq 'CODE' ) { return $self->custom_column_info->($info); } + return {}; } # remove the dump dir from @INC on destruction