Call on_connect AFTER actual connection, so we have the correct sqlt_type
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / Row.pm
index bcdcdbe..dc777fd 100644 (file)
@@ -320,7 +320,7 @@ sub inflate_result {
         push(@pre_objects, $pre_source->result_class->inflate_result(
                              $pre_source, @{$pre_rec}));
       }
-      $new->related_resultset($pre)->set_cache(\@pre_objects);
+      $new->related_resultset($pre)->set_cache('all', \@pre_objects);
     } elsif (defined $pre_val->[0]) {
       my $fetched;
       unless ($pre_source->primary_columns == grep { exists $pre_val->[0]{$_}
@@ -360,7 +360,8 @@ sub update_or_insert {
 
 =head2 is_changed
 
-  my @changed_col_names = $obj->is_changed
+  my @changed_col_names = $obj->is_changed();
+  if ($obj->is_changed()) { ... }
 
 =cut
 
@@ -368,6 +369,17 @@ sub is_changed {
   return keys %{shift->{_dirty_columns} || {}};
 }
 
+=head2 is_column_changed
+
+  if ($obj->is_column_changed('col')) { ... }
+
+=cut
+
+sub is_column_changed {
+  my( $self, $col ) = @_;
+  return exists $self->{_dirty_columns}->{$col};
+}
+
 =head2 result_source
 
   Accessor to the ResultSource this object was created from