removed ->reload_row from storage, changed this to a method based on the actual row...
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Row.pm
index ffe0359..eab11d9 100644 (file)
@@ -785,6 +785,21 @@ sub register_column {
   $class->mk_group_accessors('column' => $acc);
 }
 
+=head2 get_current_storage
+
+Returns a new Row which is whatever the Storage has for the currently created
+Row object.  You ca use this to see if the storage has become inconsistent with
+whatever your Row object is.
+
+=cut
+
+sub get_current_storage {
+    my $self = shift @_;
+    my @primary_columns = map { $self->$_ } $self->primary_columns;
+    return $self->result_source->schema->txn_do(sub {
+      return $self->result_source->resultset->find(@primary_columns);  
+    });
+}
 
 =head2 throw_exception