Remove Class::Data::Inheritable and use CAG 'inherited' style accessors
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / DestroyWarning.pm
1 package # hide from PAUSE
2     DBIx::Class::CDBICompat::DestroyWarning;
3
4 use strict;
5 use warnings;
6
7 use base 'DBIx::Class';
8
9 use DBIx::Class::_Util 'detected_reinvoked_destructor';
10 use namespace::clean;
11
12 sub DESTROY {
13   return if &detected_reinvoked_destructor;
14
15   my ($self) = @_;
16   my $class = ref $self;
17   warn "$class $self destroyed without saving changes to "
18          .join(', ', keys %{$self->{_dirty_columns} || {}})
19     if keys %{$self->{_dirty_columns} || {}};
20 }
21
22 1;