X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FInflateColumn.pm;h=5dec97d6d0bfb32f26becec0eed76a331b693f8f;hb=b82c8a28bb4cb7d704496b8ce3966565d255d5b3;hp=ee3081c4100db85b4c68662100aca46fba82dda8;hpb=ef7a8b67862cb8d034591cdc564945dc2c7a61a4;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/InflateColumn.pm b/lib/DBIx/Class/InflateColumn.pm index ee3081c..5dec97d 100644 --- a/lib/DBIx/Class/InflateColumn.pm +++ b/lib/DBIx/Class/InflateColumn.pm @@ -79,7 +79,8 @@ sub inflate_column { $self->throw_exception("inflate_column needs attr hashref") unless ref $attrs eq 'HASH'; $self->column_info($col)->{_inflate_info} = $attrs; - $self->mk_group_accessors('inflated_column' => [$self->column_info($col)->{accessor} || $col, $col]); + my $acc = $self->column_info($col)->{accessor}; + $self->mk_group_accessors('inflated_column' => [ (defined $acc ? $acc : $col), $col]); return 1; } @@ -124,8 +125,11 @@ sub get_inflated_column { unless exists $self->column_info($col)->{_inflate_info}; return $self->{_inflated_column}{$col} if exists $self->{_inflated_column}{$col}; - return $self->{_inflated_column}{$col} = - $self->_inflated_column($col, $self->get_column($col)); + + my $val = $self->get_column($col); + return $val if ref $val eq 'SCALAR'; #that would be a not-yet-reloaded sclarref update + + return $self->{_inflated_column}{$col} = $self->_inflated_column($col, $val); } =head2 set_inflated_column @@ -175,7 +179,7 @@ sub store_inflated_column { =over 4 =item L - This component is loaded as part of the - "core" L components; generally there is no need to + C L components; generally there is no need to load it directly =back