Corrected columns_info_for indent level - 2 space indent everyone please, you may...
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / Stringify.pm
CommitLineData
c0e7b4e5 1package # hide from PAUSE
2 DBIx::Class::CDBICompat::Stringify;
a3018bd3 3
4use strict;
5use warnings;
6
5d283305 7use Scalar::Util;
8
a3018bd3 9use overload
37df4bfe 10 '""' => sub { return shift->stringify_self; },
5d283305 11 fallback => 1;
a3018bd3 12
13sub stringify_self {
14 my $self = shift;
a3018bd3 15 my @cols = $self->columns('Stringify');
5d283305 16 @cols = $self->primary_column unless @cols;
2441e56f 17 my $ret = join "/", map { $self->get_column($_) || '' } @cols;
5d283305 18 return $ret || ref $self;
a3018bd3 19}
20
211;