AutoUpdate, add_constructor, a toy set_sql emulator, object index stubs and destroy...
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / DestroyWarning.pm
diff --git a/lib/DBIx/Class/CDBICompat/DestroyWarning.pm b/lib/DBIx/Class/CDBICompat/DestroyWarning.pm
new file mode 100644 (file)
index 0000000..fb5b297
--- /dev/null
@@ -0,0 +1,14 @@
+package DBIx::Class::CDBICompat::DestroyWarning;
+
+use strict;
+use warnings;
+
+sub DESTROY {
+  my ($self) = @_;
+  my $class = ref $self;
+  warn "$class $self destroyed without saving changes to "
+         .join(', ', keys %{$self->{_dirty_columns} || {}})
+    if keys %{$self->{_dirty_columns} || {}};
+}
+
+1;