From: David Kamholz <dkamholz@cpan.org>
Date: Sat, 17 Jun 2006 01:33:10 +0000 (+0000)
Subject: update to InflateColumn (docs and trivial patch)
X-Git-Tag: v0.07002~75^2~106^2~8
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=47c56124437d04c7a10f335acdeb4d8a98b0564e;p=dbsrgits%2FDBIx-Class.git

update to InflateColumn (docs and trivial patch)
---

diff --git a/lib/DBIx/Class/InflateColumn.pm b/lib/DBIx/Class/InflateColumn.pm
index db61d50..1a69269 100644
--- a/lib/DBIx/Class/InflateColumn.pm
+++ b/lib/DBIx/Class/InflateColumn.pm
@@ -144,21 +144,29 @@ sub set_inflated_column {
   my $copy = $obj->store_inflated_column($col => $val);
 
 Sets a column value from an inflated value without marking the column
-as dirty.  This is directly analogous to
-L<DBIx::Class::Row/store_column>.
+as dirty. This is directly analogous to L<DBIx::Class::Row/store_column>.
 
 =cut
 
 sub store_inflated_column {
   my ($self, $col, $obj) = @_;
-  unless (ref $obj) {
+  if (ref $obj) {
+    delete $self->{_column_data}{$col};
+    return $self->{_inflated_column}{$col} = $obj;
+  } else {
     delete $self->{_inflated_column}{$col};
-    return $self->store_column($col, $obj);
+    return $self->store_column($col, $obj);    
   }
-  delete $self->{_column_data}{$col};
-  return $self->{_inflated_column}{$col} = $obj;
 }
 
+=head2 get_column
+
+Gets a column value in the same way as L<DBIx::Class::Row/get_column>. If there
+is an inflated value stored that has not yet been deflated, it is deflated
+when the method is invoked.
+
+=cut
+
 sub get_column {
   my ($self, $col) = @_;
   $self->_deflate_column($col);