--- lib/A3C/Record.pm 2008/04/11 15:57:36 75 +++ lib/A3C/Record.pm 2008/10/01 19:58:37 240 @@ -5,6 +5,8 @@ use base 'Jifty::Record'; +use Data::Dump qw/dump/; + =head1 NAME Custom Record class for A3C @@ -25,7 +27,7 @@ ( $self, $class ) = ( $class, undef ); } else { $self = $class->new(); - } + } my %args = (@_); @@ -55,7 +57,26 @@ return $self->create(%args); } - return ( $id, $msg ); + return ( $self->id, $msg ); +} + +=head2 create + +Serialize ARRAY values into single scalar separated by magic C<< <*> >> marker + +=cut + +sub create { + #warn "# create",dump(@_); + my $self = shift; + my %data = @_ or die "no data?"; + foreach my $col ( keys %data ) { + #warn "## ref($col)=",ref($col); + $data{$col} = join(' <*> ', @{$data{$col}}) if ref( $data{$col} ) eq 'ARRAY'; + } + #warn "## data = ",dump( %data ); + $self->SUPER::create( %data ); } + 1;