The real workaround for txn_scope_guard being called twice
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / DestroyWarning.pm
CommitLineData
c0e7b4e5 1package # hide from PAUSE
2 DBIx::Class::CDBICompat::DestroyWarning;
a3018bd3 3
4use strict;
5use warnings;
3d56e026 6use DBIx::Class::_Util 'detect_reinvoked_destructor';
7use namespace::clean;
a3018bd3 8
9sub DESTROY {
3d56e026 10 return if &detect_reinvoked_destructor;
11
a3018bd3 12 my ($self) = @_;
13 my $class = ref $self;
14 warn "$class $self destroyed without saving changes to "
15 .join(', ', keys %{$self->{_dirty_columns} || {}})
16 if keys %{$self->{_dirty_columns} || {}};
17}
18
191;