[Rt-commit] rt branch, 4.2/merge-shredder-overlays, created. rt-4.2.10-104-g8944378

Alex Vandiver alexmv at bestpractical.com
Wed Mar 4 16:42:11 EST 2015


The branch, 4.2/merge-shredder-overlays has been created
        at  89443789f1765b332cf8dbdeead7f48ebc3de05c (commit)

- Log -----------------------------------------------------------------
commit f94e6c2f11b8395192b02f3a69e2b4843c5e7c31
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Aug 16 14:33:23 2011 -0400

    Pack bitmask constants more densely

diff --git a/lib/RT/Shredder/Constants.pm b/lib/RT/Shredder/Constants.pm
index d404940..1e5ba8a 100644
--- a/lib/RT/Shredder/Constants.pm
+++ b/lib/RT/Shredder/Constants.pm
@@ -87,9 +87,9 @@ change this reference when we delete user.
 =cut
 
 use constant {
-    DEPENDS_ON    => 0x000001,
-    WIPE_AFTER    => 0x000010,
-    VARIABLE    => 0x001000,
+    DEPENDS_ON => 0x01,
+    WIPE_AFTER => 0x02,
+    VARIABLE   => 0x04,
 };
 
 =head1 STATES
@@ -108,9 +108,9 @@ delete query is called once.
 =cut
 
 use constant {
-    ON_STACK    => 0x00000,
-    IN_WIPING    => 0x00001,
-    WIPED        => 0x00010,
+    ON_STACK  => 0x00,
+    IN_WIPING => 0x01,
+    WIPED     => 0x02,
 };
 
 our @EXPORT = qw(

commit 836e59616ddabe13082261cad21c3e0c59764834
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Aug 16 14:34:19 2011 -0400

    Make two bitfields not overlap, to reduce changes of mixing them

diff --git a/lib/RT/Shredder/Constants.pm b/lib/RT/Shredder/Constants.pm
index 1e5ba8a..473d706 100644
--- a/lib/RT/Shredder/Constants.pm
+++ b/lib/RT/Shredder/Constants.pm
@@ -87,9 +87,9 @@ change this reference when we delete user.
 =cut
 
 use constant {
-    DEPENDS_ON => 0x01,
-    WIPE_AFTER => 0x02,
-    VARIABLE   => 0x04,
+    DEPENDS_ON => 0x001,
+    WIPE_AFTER => 0x002,
+    VARIABLE   => 0x004,
 };
 
 =head1 STATES
@@ -108,9 +108,9 @@ delete query is called once.
 =cut
 
 use constant {
-    ON_STACK  => 0x00,
-    IN_WIPING => 0x01,
-    WIPED     => 0x02,
+    ON_STACK  => 0x000,
+    IN_WIPING => 0x010,
+    WIPED     => 0x020,
 };
 
 our @EXPORT = qw(

commit 4c84b304f1fb9d2fec26140e75e71e9ffa0b487e
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Aug 16 14:34:48 2011 -0400

    Make shredder constants no longer exported
    
    This pollutes their namespace less, in preparation for moving __Relates
    and __DependsOn into the main RT object packages

diff --git a/lib/RT/Shredder.pm b/lib/RT/Shredder.pm
index 88a2403..639d4c5 100644
--- a/lib/RT/Shredder.pm
+++ b/lib/RT/Shredder.pm
@@ -434,7 +434,10 @@ sub PutObject
     }
 
     my $str = $obj->_AsString;
-    return ($self->{'cache'}->{ $str } ||= { State => ON_STACK, Object => $obj } );
+    return ($self->{'cache'}->{ $str } ||= {
+        State  => RT::Shredder::Constants::ON_STACK,
+        Object => $obj
+    } );
 }
 
 =head4 GetObject, GetState, GetRecord( String => ''| Object => '' )
@@ -556,7 +559,7 @@ sub WipeoutAll
     my $self = $_[0];
 
     foreach my $cache_val ( values %{ $self->{'cache'} } ) {
-        next if $cache_val->{'State'} & (WIPED | IN_WIPING);
+        next if $cache_val->{'State'} & (RT::Shredder::Constants::WIPED | RT::Shredder::Constants::IN_WIPING);
         $self->Wipeout( Object => $cache_val->{'Object'} );
     }
     return;
@@ -590,9 +593,9 @@ sub _Wipeout
 
     my $record = $args{'CacheRecord'};
     $record = $self->PutObject( Object => $args{'Object'} ) unless $record;
-    return if $record->{'State'} & (WIPED | IN_WIPING);
+    return if $record->{'State'} & (RT::Shredder::Constants::WIPED | RT::Shredder::Constants::IN_WIPING);
 
-    $record->{'State'} |= IN_WIPING;
+    $record->{'State'} |= RT::Shredder::Constants::IN_WIPING;
     my $object = $record->{'Object'};
 
     $self->DumpObject( Object => $object, State => 'before any action' );
@@ -603,25 +606,25 @@ sub _Wipeout
 
     my $deps = $object->Dependencies( Shredder => $self );
     $deps->List(
-        WithFlags => DEPENDS_ON | VARIABLE,
+        WithFlags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::VARIABLE,
         Callback  => sub { $self->ApplyResolvers( Dependency => $_[0] ) },
     );
     $self->DumpObject( Object => $object, State => 'after resolvers' );
 
     $deps->List(
-        WithFlags    => DEPENDS_ON,
-        WithoutFlags => WIPE_AFTER | VARIABLE,
+        WithFlags    => RT::Shredder::Constants::DEPENDS_ON,
+        WithoutFlags => RT::Shredder::Constants::WIPE_AFTER | RT::Shredder::Constants::VARIABLE,
         Callback     => sub { $self->_Wipeout( Object => $_[0]->TargetObject ) },
     );
     $self->DumpObject( Object => $object, State => 'after wiping dependencies' );
 
     $object->__Wipeout;
-    $record->{'State'} |= WIPED; delete $record->{'Object'};
+    $record->{'State'} |= RT::Shredder::Constants::WIPED; delete $record->{'Object'};
     $self->DumpObject( Object => $object, State => 'after wipeout' );
 
     $deps->List(
-        WithFlags => DEPENDS_ON | WIPE_AFTER,
-        WithoutFlags => VARIABLE,
+        WithFlags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::WIPE_AFTER,
+        WithoutFlags => RT::Shredder::Constants::VARIABLE,
         Callback => sub { $self->_Wipeout( Object => $_[0]->TargetObject ) },
     );
     $self->DumpObject( Object => $object, State => 'after late dependencies' );
diff --git a/lib/RT/Shredder/ACE.pm b/lib/RT/Shredder/ACE.pm
index 596d5c0..cb59620 100644
--- a/lib/RT/Shredder/ACE.pm
+++ b/lib/RT/Shredder/ACE.pm
@@ -71,7 +71,7 @@ sub __DependsOn
 
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
             TargetObjects => $list,
             Shredder => $args{'Shredder'}
         );
diff --git a/lib/RT/Shredder/Attachment.pm b/lib/RT/Shredder/Attachment.pm
index 344a97b..e2c354e 100644
--- a/lib/RT/Shredder/Attachment.pm
+++ b/lib/RT/Shredder/Attachment.pm
@@ -84,7 +84,7 @@ sub __DependsOn
 
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
             TargetObjects => $list,
             Shredder => $args{'Shredder'}
         );
diff --git a/lib/RT/Shredder/CachedGroupMember.pm b/lib/RT/Shredder/CachedGroupMember.pm
index d9797f6..17e4778 100644
--- a/lib/RT/Shredder/CachedGroupMember.pm
+++ b/lib/RT/Shredder/CachedGroupMember.pm
@@ -90,7 +90,7 @@ sub __DependsOn
 
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
             TargetObjects => $list,
             Shredder => $args{'Shredder'}
         );
diff --git a/lib/RT/Shredder/Constants.pm b/lib/RT/Shredder/Constants.pm
index 473d706..82445a7 100644
--- a/lib/RT/Shredder/Constants.pm
+++ b/lib/RT/Shredder/Constants.pm
@@ -51,15 +51,13 @@ package RT::Shredder::Constants;
 use strict;
 use warnings;
 
-use base qw(Exporter);
-
 =head1 NAME
 
 RT::Shredder::Constants -  RT::Shredder constants that is used to mark state of RT objects.
 
 =head1 DESCRIPTION
 
-This module exports two group of bit constants.
+This module contains two group of bit constants.
 First group is group of flags which are used to clarify dependecies between objects, and
 second group is states of RT objects in Shredder cache.
 
@@ -113,13 +111,4 @@ use constant {
     WIPED     => 0x020,
 };
 
-our @EXPORT = qw(
-        DEPENDS_ON
-        WIPE_AFTER
-        VARIABLE
-        ON_STACK
-        IN_WIPING
-        WIPED
-        );
-
 1;
diff --git a/lib/RT/Shredder/CustomField.pm b/lib/RT/Shredder/CustomField.pm
index 51788ff..bad4a5e 100644
--- a/lib/RT/Shredder/CustomField.pm
+++ b/lib/RT/Shredder/CustomField.pm
@@ -80,7 +80,7 @@ sub __DependsOn
 
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
             TargetObjects => $list,
             Shredder => $args{'Shredder'}
         );
diff --git a/lib/RT/Shredder/Dependencies.pm b/lib/RT/Shredder/Dependencies.pm
index 3ffebfd..a78fd0c 100644
--- a/lib/RT/Shredder/Dependencies.pm
+++ b/lib/RT/Shredder/Dependencies.pm
@@ -107,7 +107,7 @@ sub _PushDependency
             @_
            );
     my $rec = $args{'Shredder'}->PutObject( Object => $args{'TargetObject'} );
-    return if $rec->{'State'} & WIPED; # there is no object anymore
+    return if $rec->{'State'} & RT::Shredder::Constants::WIPED; # there is no object anymore
 
     push @{ $self->{'list'} },
         RT::Shredder::Dependency->new(
diff --git a/lib/RT/Shredder/Dependency.pm b/lib/RT/Shredder/Dependency.pm
index 484489d..2a7be40 100644
--- a/lib/RT/Shredder/Dependency.pm
+++ b/lib/RT/Shredder/Dependency.pm
@@ -54,9 +54,9 @@ use RT::Shredder::Constants;
 use RT::Shredder::Exceptions;
 
 my %FlagDescs = (
-    DEPENDS_ON, 'depends on',
-    VARIABLE,   'resolvable dependency',
-    WIPE_AFTER, 'delete after',
+    RT::Shredder::Constants::DEPENDS_ON, 'depends on',
+    RT::Shredder::Constants::VARIABLE,   'resolvable dependency',
+    RT::Shredder::Constants::WIPE_AFTER, 'delete after',
 );
 
 sub new
@@ -70,7 +70,7 @@ sub new
 sub Set
 {
     my $self = shift;
-    my %args = ( Flags => DEPENDS_ON, @_ );
+    my %args = ( Flags => RT::Shredder::Constants::DEPENDS_ON, @_ );
     my @keys = qw(Flags BaseObject TargetObject);
     @$self{ @keys } = @args{ @keys };
 
diff --git a/lib/RT/Shredder/Group.pm b/lib/RT/Shredder/Group.pm
index 3329364..37d9841 100644
--- a/lib/RT/Shredder/Group.pm
+++ b/lib/RT/Shredder/Group.pm
@@ -77,7 +77,7 @@ sub __DependsOn
         $objs->Load( $self->Instance );
         $deps->_PushDependency(
                 BaseObject => $self,
-                Flags => DEPENDS_ON | WIPE_AFTER,
+                Flags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::WIPE_AFTER,
                 TargetObject => $objs,
                 Shredder => $args{'Shredder'}
             );
@@ -86,7 +86,7 @@ sub __DependsOn
 # Principal
     $deps->_PushDependency(
             BaseObject => $self,
-            Flags => DEPENDS_ON | WIPE_AFTER,
+            Flags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::WIPE_AFTER,
             TargetObject => $self->PrincipalObj,
             Shredder => $args{'Shredder'}
         );
@@ -121,7 +121,7 @@ sub __DependsOn
 
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
             TargetObjects => $list,
             Shredder => $args{'Shredder'}
         );
diff --git a/lib/RT/Shredder/GroupMember.pm b/lib/RT/Shredder/GroupMember.pm
index 2c03694..94a535b 100644
--- a/lib/RT/Shredder/GroupMember.pm
+++ b/lib/RT/Shredder/GroupMember.pm
@@ -79,7 +79,7 @@ sub __DependsOn
 
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
             TargetObjects => $list,
             Shredder => $args{'Shredder'}
         );
@@ -95,7 +95,7 @@ sub __DependsOn
     # we don't delete group, so we have to fix Ticket and Group
     $deps->_PushDependencies(
                 BaseObject => $self,
-                Flags => DEPENDS_ON | VARIABLE,
+                Flags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::VARIABLE,
                 TargetObjects => $group,
                 Shredder => $args{'Shredder'}
         );
@@ -105,7 +105,8 @@ sub __DependsOn
             Code => sub {
                 my %args = (@_);
                 my $group = $args{'TargetObject'};
-                return if $args{'Shredder'}->GetState( Object => $group ) & (WIPED|IN_WIPING);
+                return if $args{'Shredder'}->GetState( Object => $group )
+                    & (RT::Shredder::Constants::WIPED|RT::Shredder::Constants::IN_WIPING);
                 return unless ($group->Name || '') eq 'Owner';
                 return unless ($group->Domain || '') eq 'RT::Ticket-Role';
 
diff --git a/lib/RT/Shredder/Link.pm b/lib/RT/Shredder/Link.pm
index 90168d4..7512406 100644
--- a/lib/RT/Shredder/Link.pm
+++ b/lib/RT/Shredder/Link.pm
@@ -112,7 +112,7 @@ sub __DependsOn
 
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON|WIPE_AFTER,
+            Flags => RT::Shredder::Constants::DEPENDS_ON|RT::Shredder::Constants::WIPE_AFTER,
             TargetObjects => $list,
             Shredder => $args{'Shredder'}
         );
diff --git a/lib/RT/Shredder/Principal.pm b/lib/RT/Shredder/Principal.pm
index a54eec7..3abb1ba 100644
--- a/lib/RT/Shredder/Principal.pm
+++ b/lib/RT/Shredder/Principal.pm
@@ -95,7 +95,7 @@ sub __DependsOn
 
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
             TargetObjects => $list,
             Shredder => $args{'Shredder'}
         );
diff --git a/lib/RT/Shredder/Queue.pm b/lib/RT/Shredder/Queue.pm
index 2e4df89..eed42db 100644
--- a/lib/RT/Shredder/Queue.pm
+++ b/lib/RT/Shredder/Queue.pm
@@ -97,7 +97,7 @@ sub __DependsOn
 
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
             TargetObjects => $list,
             Shredder => $args{'Shredder'}
         );
diff --git a/lib/RT/Shredder/Record.pm b/lib/RT/Shredder/Record.pm
index 6a2a3de..02c871a 100644
--- a/lib/RT/Shredder/Record.pm
+++ b/lib/RT/Shredder/Record.pm
@@ -100,7 +100,7 @@ sub Dependencies
     my $self = shift;
     my %args = (
             Shredder => undef,
-            Flags => DEPENDS_ON,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
             @_,
            );
 
@@ -109,7 +109,7 @@ sub Dependencies
     }
 
     my $deps = RT::Shredder::Dependencies->new();
-    if( $args{'Flags'} & DEPENDS_ON ) {
+    if( $args{'Flags'} & RT::Shredder::Constants::DEPENDS_ON ) {
         $self->__DependsOn( %args, Dependencies => $deps );
     }
     return $deps;
@@ -161,7 +161,7 @@ sub __DependsOn
 
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
             TargetObjects => $list,
             Shredder => $args{'Shredder'}
         );
diff --git a/lib/RT/Shredder/Scrip.pm b/lib/RT/Shredder/Scrip.pm
index 8711d31..9ce7463 100644
--- a/lib/RT/Shredder/Scrip.pm
+++ b/lib/RT/Shredder/Scrip.pm
@@ -74,7 +74,7 @@ sub __DependsOn
 
     $deps->_PushDependencies(
         BaseObject    => $self,
-        Flags         => DEPENDS_ON,
+        Flags         => RT::Shredder::Constants::DEPENDS_ON,
         TargetObjects => $list,
         Shredder      => $args{'Shredder'}
     );
diff --git a/lib/RT/Shredder/ScripAction.pm b/lib/RT/Shredder/ScripAction.pm
index ee099a3..5b578b7 100644
--- a/lib/RT/Shredder/ScripAction.pm
+++ b/lib/RT/Shredder/ScripAction.pm
@@ -73,7 +73,7 @@ sub __DependsOn
     $objs->Limit( FIELD => 'ScripAction', VALUE => $self->Id );
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
             TargetObjects => $objs,
             Shredder => $args{'Shredder'}
         );
diff --git a/lib/RT/Shredder/ScripCondition.pm b/lib/RT/Shredder/ScripCondition.pm
index 80567f2..bdff8e2 100644
--- a/lib/RT/Shredder/ScripCondition.pm
+++ b/lib/RT/Shredder/ScripCondition.pm
@@ -73,7 +73,7 @@ sub __DependsOn
     $objs->Limit( FIELD => 'ScripCondition', VALUE => $self->Id );
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
             TargetObjects => $objs,
             Shredder => $args{'Shredder'}
         );
diff --git a/lib/RT/Shredder/Template.pm b/lib/RT/Shredder/Template.pm
index 28fbaec..7ca4b3d 100644
--- a/lib/RT/Shredder/Template.pm
+++ b/lib/RT/Shredder/Template.pm
@@ -73,7 +73,7 @@ sub __DependsOn
 
     $deps->_PushDependencies(
         BaseObject => $self,
-        Flags => DEPENDS_ON,
+        Flags => RT::Shredder::Constants::DEPENDS_ON,
         TargetObjects => $list,
         Shredder => $args{'Shredder'},
     );
diff --git a/lib/RT/Shredder/Ticket.pm b/lib/RT/Shredder/Ticket.pm
index 3b2f2b8..598b465 100644
--- a/lib/RT/Shredder/Ticket.pm
+++ b/lib/RT/Shredder/Ticket.pm
@@ -84,7 +84,7 @@ sub __DependsOn
 #TODO: Users, Queues if we wish export tool
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
             TargetObjects => $list,
             Shredder => $args{'Shredder'}
         );
diff --git a/lib/RT/Shredder/Transaction.pm b/lib/RT/Shredder/Transaction.pm
index bfbfc4b..f33fa7b 100644
--- a/lib/RT/Shredder/Transaction.pm
+++ b/lib/RT/Shredder/Transaction.pm
@@ -71,7 +71,7 @@ sub __DependsOn
 # Attachments
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
             TargetObjects => $self->Attachments,
             Shredder => $args{'Shredder'}
         );
diff --git a/lib/RT/Shredder/User.pm b/lib/RT/Shredder/User.pm
index 2f9d699..353ecb3 100644
--- a/lib/RT/Shredder/User.pm
+++ b/lib/RT/Shredder/User.pm
@@ -91,7 +91,7 @@ sub __DependsOn
 # Principal
     $deps->_PushDependency(
             BaseObject => $self,
-            Flags => DEPENDS_ON | WIPE_AFTER,
+            Flags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::WIPE_AFTER,
             TargetObject => $self->PrincipalObj,
             Shredder => $args{'Shredder'}
         );
@@ -110,7 +110,7 @@ sub __DependsOn
 
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
             TargetObjects => $list,
             Shredder => $args{'Shredder'}
         );
@@ -129,7 +129,7 @@ sub __DependsOn
     }
     $deps->_PushDependencies(
             BaseObject => $self,
-            Flags => DEPENDS_ON | VARIABLE,
+            Flags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::VARIABLE,
             TargetObjects => \@var_objs,
             Shredder => $args{'Shredder'}
         );

commit f363a0bdc2b43795edbd6f9700b03a78a9b2c313
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri May 23 18:39:37 2014 -0400

    Replace ->_AsString with ->UID

diff --git a/lib/RT/Shredder.pm b/lib/RT/Shredder.pm
index 639d4c5..aa0afbc 100644
--- a/lib/RT/Shredder.pm
+++ b/lib/RT/Shredder.pm
@@ -367,7 +367,14 @@ sub CastObjectsToRecords
         }
     } elsif ( UNIVERSAL::isa( $targets, 'SCALAR' ) || !ref $targets ) {
         $targets = $$targets if ref $targets;
-        my ($class, $id) = split /-/, $targets;
+        my ($class, $org, $id);
+        if ($targets =~ /-.*-/) {
+            ($class, $org, $id) = split /-/, $targets;
+            RT::Shredder::Exception->throw( "Can't wipeout remote object $targets" )
+                  unless $org eq RT->Config->Get('Organization');
+        } else {
+            ($class, $id) = split /-/, $targets;
+        }
         RT::Shredder::Exception->throw( "Unsupported class $class" )
               unless $class =~ /^\w+(::\w+)*$/;
         $class = 'RT::'. $class unless $class =~ /^RTx?::/i;
@@ -433,7 +440,7 @@ sub PutObject
         RT::Shredder::Exception->throw( "Unsupported type '". (ref $obj || $obj || '(undef)')."'" );
     }
 
-    my $str = $obj->_AsString;
+    my $str = $obj->UID;
     return ($self->{'cache'}->{ $str } ||= {
         State  => RT::Shredder::Constants::ON_STACK,
         Object => $obj
@@ -465,7 +472,7 @@ sub _ParseRefStrArgs
         Carp::croak( "both String and Object args passed" );
     }
     return $args{'String'} if $args{'String'};
-    return $args{'Object'}->_AsString if UNIVERSAL::can($args{'Object'}, '_AsString' );
+    return $args{'Object'}->UID if UNIVERSAL::can($args{'Object'}, 'UID' );
     return '';
 }
 
diff --git a/lib/RT/Shredder/Dependency.pm b/lib/RT/Shredder/Dependency.pm
index 2a7be40..ad72f3b 100644
--- a/lib/RT/Shredder/Dependency.pm
+++ b/lib/RT/Shredder/Dependency.pm
@@ -80,9 +80,9 @@ sub Set
 sub AsString
 {
     my $self = shift;
-    my $res = $self->BaseObject->_AsString;
+    my $res = $self->BaseObject->UID;
     $res .= " ". $self->FlagsAsString;
-    $res .= " ". $self->TargetObject->_AsString;
+    $res .= " ". $self->TargetObject->UID;
     return $res;
 }
 
diff --git a/lib/RT/Shredder/Plugin/Summary.pm b/lib/RT/Shredder/Plugin/Summary.pm
index 51fdf7f..7442c6d 100644
--- a/lib/RT/Shredder/Plugin/Summary.pm
+++ b/lib/RT/Shredder/Plugin/Summary.pm
@@ -114,7 +114,7 @@ sub WriteDownGroup {
     my $self = shift;
     my %args = ( Object => undef, @_ );
     if ( $args{'Object'}->RoleClass ) {
-        return $skip_refs_to{ $args{'Object'}->_AsString } = 1;
+        return $skip_refs_to{ $args{'Object'}->UID } = 1;
     }
     return $self->WriteDownDefault( %args );
 }
@@ -153,7 +153,7 @@ sub _MakeHash {
     foreach (grep exists $hash->{$_}, qw(Creator LastUpdatedBy)) {
         my $method = $_ .'Obj';
         my $u = $obj->$method();
-        $hash->{ $_ } = $u->EmailAddress || $u->Name || $u->_AsString;
+        $hash->{ $_ } = $u->EmailAddress || $u->Name || $u->UID;
     }
     return $hash;
 }
@@ -170,7 +170,7 @@ sub _WriteDownHash {
     my ($self, $obj, $hash) = @_;
     return (0, 'no handle') unless my $fh = $self->{'opt'}{'file_handle'};
 
-    print $fh "=== ". $obj->_AsString ." ===\n"
+    print $fh "=== ". $obj->UID ." ===\n"
         or return (0, "Couldn't write to filehandle");
 
     foreach my $key( sort keys %$hash ) {
diff --git a/lib/RT/Shredder/Record.pm b/lib/RT/Shredder/Record.pm
index 02c871a..1e777ba 100644
--- a/lib/RT/Shredder/Record.pm
+++ b/lib/RT/Shredder/Record.pm
@@ -56,14 +56,6 @@ use warnings FATAL => 'redefine';
 use RT::Shredder::Constants;
 use RT::Shredder::Exceptions;
 
-=head2 _AsString
-
-Returns string in format ClassName-ObjectId.
-
-=cut
-
-sub _AsString { return ref($_[0]) ."-". $_[0]->id }
-
 =head2 _AsInsertQuery
 
 Returns INSERT query string that duplicates current record and
@@ -173,7 +165,7 @@ sub __DependsOn
 sub __Wipeout
 {
     my $self = shift;
-    my $msg = $self->_AsString ." wiped out";
+    my $msg = $self->UID ." wiped out";
     $self->SUPER::Delete;
     $RT::Logger->info( $msg );
     return;
diff --git a/sbin/rt-shredder.in b/sbin/rt-shredder.in
index 707edf9..a6cb6f4 100644
--- a/sbin/rt-shredder.in
+++ b/sbin/rt-shredder.in
@@ -185,7 +185,7 @@ sub prompt_delete_objs
     }
     my $list = "Next ". scalar( @$objs ) ." objects would be deleted:\n";
     foreach my $o( @$objs ) {
-        $list .= "\t". $o->_AsString ." object\n";
+        $list .= "\t". $o->UID ." object\n";
     }
     print $list;
     exit(0) unless prompt_yN( "Do you want to proceed?" );
diff --git a/share/html/Admin/Tools/Shredder/Elements/ObjectCheckBox b/share/html/Admin/Tools/Shredder/Elements/ObjectCheckBox
index 757e106..e333d07 100644
--- a/share/html/Admin/Tools/Shredder/Elements/ObjectCheckBox
+++ b/share/html/Admin/Tools/Shredder/Elements/ObjectCheckBox
@@ -48,12 +48,12 @@
 <%ARGS>
 $Object => undef
 </%ARGS>
-<input type="checkbox" name="WipeoutObject" value="<% $Object->_AsString %>" />
+<input type="checkbox" name="WipeoutObject" value="<% $Object->UID %>" />
 <span>
 % if( $m->comp_exists( $path ) ) {
 % $m->comp( $path, Object => $Object );
 % } else {
-<% $Object->_AsString %>
+<% $Object->UID %>
 % }
 </span><br />
 <%ONCE>

commit 793020d61715cb776e011e2dba0fd20319950cea
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Aug 16 14:59:26 2011 -0400

    Merge RT::Shredder::Record into RT::Record

diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index 7dc7809..a449998 100644
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -75,6 +75,8 @@ require RT::User;
 require RT::Attributes;
 require RT::Transactions;
 require RT::Link;
+use RT::Shredder::Constants;
+use RT::Shredder::Exceptions;
 
 our $_TABLE_ATTR = { };
 
@@ -2538,6 +2540,121 @@ sub PreInflate {
 sub PostInflate {
 }
 
+=head2 _AsInsertQuery
+
+Returns INSERT query string that duplicates current record and
+can be used to insert record back into DB after delete.
+
+=cut
+
+sub _AsInsertQuery
+{
+    my $self = shift;
+
+    my $dbh = $RT::Handle->dbh;
+
+    my $res = "INSERT INTO ". $dbh->quote_identifier( $self->Table );
+    my $values = $self->{'values'};
+    $res .= "(". join( ",", map { $dbh->quote_identifier( $_ ) } sort keys %$values ) .")";
+    $res .= " VALUES";
+    $res .= "(". join( ",", map { $dbh->quote( $values->{$_} ) } sort keys %$values ) .")";
+    $res .= ";";
+
+    return $res;
+}
+
+sub BeforeWipeout { return 1 }
+
+=head2 Dependencies
+
+Returns L<RT::Shredder::Dependencies> object.
+
+=cut
+
+sub Dependencies
+{
+    my $self = shift;
+    my %args = (
+            Shredder => undef,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
+            @_,
+           );
+
+    unless( $self->id ) {
+        RT::Shredder::Exception->throw('Object is not loaded');
+    }
+
+    my $deps = RT::Shredder::Dependencies->new();
+    if( $args{'Flags'} & RT::Shredder::Constants::DEPENDS_ON ) {
+        $self->__DependsOn( %args, Dependencies => $deps );
+    }
+    return $deps;
+}
+
+sub __DependsOn
+{
+    my $self = shift;
+    my %args = (
+            Shredder => undef,
+            Dependencies => undef,
+            @_,
+           );
+    my $deps = $args{'Dependencies'};
+    my $list = [];
+
+# Object custom field values
+    my $objs = $self->CustomFieldValues;
+    $objs->{'find_expired_rows'} = 1;
+    push( @$list, $objs );
+
+# Object attributes
+    $objs = $self->Attributes;
+    push( @$list, $objs );
+
+# Transactions
+    $objs = RT::Transactions->new( $self->CurrentUser );
+    $objs->Limit( FIELD => 'ObjectType', VALUE => ref $self );
+    $objs->Limit( FIELD => 'ObjectId', VALUE => $self->id );
+    push( @$list, $objs );
+
+# Links
+    if ( $self->can('Links') ) {
+        # make sure we don't skip any record
+        no warnings 'redefine';
+        local *RT::Links::IsValidLink = sub { 1 };
+
+        foreach ( qw(Base Target) ) {
+            my $objs = $self->Links( $_ );
+            $objs->_DoSearch;
+            push @$list, $objs->ItemsArrayRef;
+        }
+    }
+
+# ACE records
+    $objs = RT::ACL->new( $self->CurrentUser );
+    $objs->LimitToObject( $self );
+    push( @$list, $objs );
+
+    $deps->_PushDependencies(
+            BaseObject => $self,
+            Flags => RT::Shredder::Constants::DEPENDS_ON,
+            TargetObjects => $list,
+            Shredder => $args{'Shredder'}
+        );
+    return;
+}
+
+# implement proxy method because some RT classes
+# override Delete method
+sub __Wipeout
+{
+    my $self = shift;
+    my $msg = $self->UID ." wiped out";
+    $self->SUPER::Delete;
+    $RT::Logger->info( $msg );
+    return;
+}
+
 RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Shredder.pm b/lib/RT/Shredder.pm
index aa0afbc..047e7c6 100644
--- a/lib/RT/Shredder.pm
+++ b/lib/RT/Shredder.pm
@@ -226,8 +226,6 @@ BEGIN {
 
     require RT;
 
-    require RT::Shredder::Record;
-
     require RT::Shredder::ACE;
     require RT::Shredder::Attachment;
     require RT::Shredder::CachedGroupMember;
diff --git a/lib/RT/Shredder/Link.pm b/lib/RT/Shredder/Link.pm
index 7512406..b0e61c2 100644
--- a/lib/RT/Shredder/Link.pm
+++ b/lib/RT/Shredder/Link.pm
@@ -58,7 +58,6 @@ use RT::Shredder::Dependencies;
 use RT::Shredder::Constants;
 
 use RT::Shredder::Transaction;
-use RT::Shredder::Record;
 
 sub __DependsOn
 {

commit 4d49320fc5b2594b1313341dddb1c354bc652a4b
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Aug 16 15:23:15 2011 -0400

    Add new object types which have Creator and LastUpdatedBy

diff --git a/lib/RT/Shredder/User.pm b/lib/RT/Shredder/User.pm
index 353ecb3..7a83c16 100644
--- a/lib/RT/Shredder/User.pm
+++ b/lib/RT/Shredder/User.pm
@@ -58,20 +58,27 @@ use RT::Shredder::Exceptions;
 use RT::Shredder::Dependencies;
 
 my @OBJECTS = qw(
+    ACL
+    Articles
     Attachments
+    Attributes
     CachedGroupMembers
-    CustomFields
+    Classes
     CustomFieldValues
+    CustomFields
     GroupMembers
     Groups
     Links
+    ObjectClasses
+    ObjectCustomFieldValues
+    ObjectCustomFields
+    ObjectScrips
     Principals
     Queues
     ScripActions
     ScripConditions
     Scrips
     Templates
-    ObjectCustomFieldValues
     Tickets
     Transactions
     Users

commit ec05aa12f608cbbe7bd7c54653675a68605cd211
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri May 23 19:19:00 2014 -0400

    Remove Shredder subclasses with no __DependsOn

diff --git a/lib/RT/Shredder.pm b/lib/RT/Shredder.pm
index 047e7c6..6f37334 100644
--- a/lib/RT/Shredder.pm
+++ b/lib/RT/Shredder.pm
@@ -226,11 +226,9 @@ BEGIN {
 
     require RT;
 
-    require RT::Shredder::ACE;
     require RT::Shredder::Attachment;
     require RT::Shredder::CachedGroupMember;
     require RT::Shredder::CustomField;
-    require RT::Shredder::CustomFieldValue;
     require RT::Shredder::GroupMember;
     require RT::Shredder::Group;
     require RT::Shredder::Link;
@@ -240,7 +238,6 @@ BEGIN {
     require RT::Shredder::ScripAction;
     require RT::Shredder::ScripCondition;
     require RT::Shredder::Template;
-    require RT::Shredder::ObjectCustomFieldValue;
     require RT::Shredder::Ticket;
     require RT::Shredder::Transaction;
     require RT::Shredder::User;
diff --git a/lib/RT/Shredder/ACE.pm b/lib/RT/Shredder/ACE.pm
deleted file mode 100644
index cb59620..0000000
--- a/lib/RT/Shredder/ACE.pm
+++ /dev/null
@@ -1,81 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::ACE;
-use RT::ACE ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Exceptions;
-use RT::Shredder::Constants;
-use RT::Shredder::Dependencies;
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-            Shredder => undef,
-            Dependencies => undef,
-            @_,
-           );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-
-    $deps->_PushDependencies(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON,
-            TargetObjects => $list,
-            Shredder => $args{'Shredder'}
-        );
-    return $self->SUPER::__DependsOn( %args );
-}
-
-1;
diff --git a/lib/RT/Shredder/CustomFieldValue.pm b/lib/RT/Shredder/CustomFieldValue.pm
deleted file mode 100644
index 3af4446..0000000
--- a/lib/RT/Shredder/CustomFieldValue.pm
+++ /dev/null
@@ -1,64 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::CustomFieldValue;
-use RT::CustomFieldValue ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependencies;
-
-# No dependencies that should be deleted with record
-# I should decide is TicketCustomFieldValue depends by this or not.
-# Today I think no. What would be tomorrow I don't know.
-
-1;
diff --git a/lib/RT/Shredder/ObjectCustomFieldValue.pm b/lib/RT/Shredder/ObjectCustomFieldValue.pm
deleted file mode 100644
index d1bffdf..0000000
--- a/lib/RT/Shredder/ObjectCustomFieldValue.pm
+++ /dev/null
@@ -1,60 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::ObjectCustomFieldValue;
-use RT::ObjectCustomFieldValue ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependencies;
-
-1;

commit 89443789f1765b332cf8dbdeead7f48ebc3de05c
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Aug 16 16:16:17 2011 -0400

    Fold RT::Shredder code into core record classes
    
    Previously, we blew methods into the main record classes at run-time
    when RT::Shredder was loaded.  Instead, fold them into the core instead;
    the lazy-loading was a side-effect of the code having originally been
    written as an extension, and is no longer necessary.

diff --git a/lib/RT/Attachment.pm b/lib/RT/Attachment.pm
index c727ea6..f708c00 100644
--- a/lib/RT/Attachment.pm
+++ b/lib/RT/Attachment.pm
@@ -1140,6 +1140,39 @@ sub FindDependencies {
     $deps->Add( out => $self->TransactionObj );
 }
 
+sub __DependsOn {
+    my $self = shift;
+    my %args = (
+        Shredder => undef,
+        Dependencies => undef,
+        @_,
+    );
+    my $deps = $args{'Dependencies'};
+    my $list = [];
+
+    # Nested attachments
+    my $objs = RT::Attachments->new( $self->CurrentUser );
+    $objs->Limit(
+        FIELD => 'Parent',
+        OPERATOR        => '=',
+        VALUE           => $self->Id
+    );
+    $objs->Limit(
+        FIELD => 'id',
+        OPERATOR        => '!=',
+        VALUE           => $self->Id
+    );
+    push( @$list, $objs );
+
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON,
+        TargetObjects => $list,
+        Shredder => $args{'Shredder'}
+    );
+    return $self->SUPER::__DependsOn( %args );
+}
+
 RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/CachedGroupMember.pm b/lib/RT/CachedGroupMember.pm
index fa72eb5..f5d62c2 100644
--- a/lib/RT/CachedGroupMember.pm
+++ b/lib/RT/CachedGroupMember.pm
@@ -437,6 +437,45 @@ sub Serialize {
     die "CachedGroupMembers should never be serialized";
 }
 
+sub __DependsOn
+{
+    my $self = shift;
+    my %args = (
+        Shredder => undef,
+        Dependencies => undef,
+        @_,
+    );
+    my $deps = $args{'Dependencies'};
+    my $list = [];
+
+# deep memebership
+    my $objs = RT::CachedGroupMembers->new( $self->CurrentUser );
+    $objs->Limit( FIELD => 'Via', VALUE => $self->Id );
+    $objs->Limit( FIELD => 'id', OPERATOR => '!=', VALUE => $self->Id );
+    push( @$list, $objs );
+
+# principal lost group membership and lost some rights which he could delegate to
+# some body
+
+# XXX: Here is problem cause HasMemberRecursively would return true allways
+# cause we didn't delete anything yet. :(
+    # if pricipal is not member anymore(could be via other groups) then proceed
+    if( $self->GroupObj->Object->HasMemberRecursively( $self->MemberObj ) ) {
+        my $acl = RT::ACL->new( $self->CurrentUser );
+        $acl->LimitToPrincipal( Id => $self->GroupId );
+    }
+
+
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON,
+        TargetObjects => $list,
+        Shredder => $args{'Shredder'}
+    );
+
+    return $self->SUPER::__DependsOn( %args );
+}
+
 RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/CustomField.pm b/lib/RT/CustomField.pm
index 89283c0..0603927 100644
--- a/lib/RT/CustomField.pm
+++ b/lib/RT/CustomField.pm
@@ -2304,6 +2304,32 @@ sub FindDependencies {
     $deps->Add( in => $self->Values ) if $self->ValuesClass eq "RT::CustomFieldValues";
 }
 
+sub __DependsOn {
+    my $self = shift;
+    my %args = (
+        Shredder => undef,
+        Dependencies => undef,
+        @_,
+    );
+    my $deps = $args{'Dependencies'};
+    my $list = [];
+
+# Custom field values
+    push( @$list, $self->Values );
+
+# Ticket custom field values
+    my $objs = RT::ObjectCustomFieldValues->new( $self->CurrentUser );
+    $objs->LimitToCustomField( $self->Id );
+    push( @$list, $objs );
+
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON,
+        TargetObjects => $list,
+        Shredder => $args{'Shredder'}
+    );
+    return $self->SUPER::__DependsOn( %args );
+}
 
 RT::Base->_ImportOverlays();
 
diff --git a/lib/RT/Group.pm b/lib/RT/Group.pm
index 606ab7e..b79f474 100644
--- a/lib/RT/Group.pm
+++ b/lib/RT/Group.pm
@@ -1626,6 +1626,83 @@ sub FindDependencies {
     $deps->Add( in => $objs );
 }
 
+sub __DependsOn {
+    my $self = shift;
+    my %args = (
+        Shredder => undef,
+        Dependencies => undef,
+        @_,
+    );
+    my $deps = $args{'Dependencies'};
+    my $list = [];
+
+# User is inconsistent without own Equivalence group
+    if( $self->Domain eq 'ACLEquivalence' ) {
+        # delete user entry after ACL equiv group
+        # in other case we will get deep recursion
+        my $objs = RT::User->new($self->CurrentUser);
+        $objs->Load( $self->Instance );
+        $deps->_PushDependency(
+            BaseObject => $self,
+            Flags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::WIPE_AFTER,
+            TargetObject => $objs,
+            Shredder => $args{'Shredder'}
+        );
+    }
+
+# Principal
+    $deps->_PushDependency(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::WIPE_AFTER,
+        TargetObject => $self->PrincipalObj,
+        Shredder => $args{'Shredder'}
+    );
+
+# Group members records
+    my $objs = RT::GroupMembers->new( $self->CurrentUser );
+    $objs->LimitToMembersOfGroup( $self->PrincipalId );
+    push( @$list, $objs );
+
+# Group member records group belongs to
+    $objs = RT::GroupMembers->new( $self->CurrentUser );
+    $objs->Limit(
+        VALUE => $self->PrincipalId,
+        FIELD => 'MemberId',
+        ENTRYAGGREGATOR => 'OR',
+        QUOTEVALUE => 0
+    );
+    push( @$list, $objs );
+
+# Cached group members records
+    push( @$list, $self->DeepMembersObj );
+
+# Cached group member records group belongs to
+    $objs = RT::GroupMembers->new( $self->CurrentUser );
+    $objs->Limit(
+        VALUE => $self->PrincipalId,
+        FIELD => 'MemberId',
+        ENTRYAGGREGATOR => 'OR',
+        QUOTEVALUE => 0
+    );
+    push( @$list, $objs );
+
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON,
+        TargetObjects => $list,
+        Shredder => $args{'Shredder'}
+    );
+    return $self->SUPER::__DependsOn( %args );
+}
+
+sub BeforeWipeout {
+    my $self = shift;
+    if( $self->Domain eq 'SystemInternal' ) {
+        RT::Shredder::Exception::Info->throw('SystemObject');
+    }
+    return $self->SUPER::BeforeWipeout( @_ );
+}
+
 sub Serialize {
     my $self = shift;
     my %args = (@_);
diff --git a/lib/RT/GroupMember.pm b/lib/RT/GroupMember.pm
index 1a4ebe1..6fc6002 100644
--- a/lib/RT/GroupMember.pm
+++ b/lib/RT/GroupMember.pm
@@ -506,6 +506,73 @@ sub FindDependencies {
     $deps->Add( out => $self->MemberObj->Object );
 }
 
+sub __DependsOn {
+    my $self = shift;
+    my %args = (
+        Shredder => undef,
+        Dependencies => undef,
+        @_,
+    );
+    my $deps = $args{'Dependencies'};
+    my $list = [];
+
+    my $objs = RT::CachedGroupMembers->new( $self->CurrentUser );
+    $objs->Limit( FIELD => 'MemberId', VALUE => $self->MemberId );
+    $objs->Limit( FIELD => 'ImmediateParentId', VALUE => $self->GroupId );
+    push( @$list, $objs );
+
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON,
+        TargetObjects => $list,
+        Shredder => $args{'Shredder'}
+    );
+
+    my $group = $self->GroupObj->Object;
+    # XXX: If we delete member of the ticket owner role group then we should also
+    # fix ticket object, but only if we don't plan to delete group itself!
+    unless( ($group->Name || '') eq 'Owner' &&
+        ($group->Domain || '') eq 'RT::Ticket-Role' ) {
+        return $self->SUPER::__DependsOn( %args );
+    }
+
+    # we don't delete group, so we have to fix Ticket and Group
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::VARIABLE,
+        TargetObjects => $group,
+        Shredder => $args{'Shredder'}
+    );
+    $args{'Shredder'}->PutResolver(
+        BaseClass => ref $self,
+        TargetClass => ref $group,
+        Code => sub {
+            my %args = (@_);
+            my $group = $args{'TargetObject'};
+            return if $args{'Shredder'}->GetState( Object => $group )
+                & (RT::Shredder::Constants::WIPED|RT::Shredder::Constants::IN_WIPING);
+            return unless ($group->Name || '') eq 'Owner';
+            return unless ($group->Domain || '') eq 'RT::Ticket-Role';
+
+            return if $group->MembersObj->Count > 1;
+
+            my $group_member = $args{'BaseObject'};
+
+            if( $group_member->MemberObj->id == RT->Nobody->id ) {
+                RT::Shredder::Exception->throw( "Couldn't delete Nobody from owners role group" );
+            }
+
+            my( $status, $msg ) = $group->AddMember( RT->Nobody->id );
+
+            RT::Shredder::Exception->throw( $msg ) unless $status;
+
+            return;
+        },
+    );
+
+    return $self->SUPER::__DependsOn( %args );
+}
+
 sub PreInflate {
     my $class = shift;
     my ($importer, $uid, $data) = @_;
diff --git a/lib/RT/Link.pm b/lib/RT/Link.pm
index e5d5d6a..f82cf51 100644
--- a/lib/RT/Link.pm
+++ b/lib/RT/Link.pm
@@ -493,6 +493,64 @@ sub FindDependencies {
     $deps->Add( out => $self->TargetObj ) if $self->TargetObj and $self->TargetObj->id;
 }
 
+sub __DependsOn {
+    my $self = shift;
+    my %args = (
+        Shredder => undef,
+        Dependencies => undef,
+        @_,
+    );
+    my $deps = $args{'Dependencies'};
+    my $list = [];
+
+# AddLink transactions
+    my $map = { %RT::Link::TYPEMAP };
+    my $link_meta = $map->{ $self->Type };
+    unless ( $link_meta && $link_meta->{'Mode'} && $link_meta->{'Type'} ) {
+        RT::Shredder::Exception->throw( 'Wrong link link_meta, no record for '. $self->Type );
+    }
+    if ( $self->BaseURI->IsLocal ) {
+        my $objs = $self->BaseObj->Transactions;
+        $objs->Limit(
+            FIELD    => 'Type',
+            OPERATOR => '=',
+            VALUE    => 'AddLink',
+        );
+        $objs->Limit( FIELD => 'NewValue', VALUE => $self->Target );
+        while ( my ($k, $v) = each %$map ) {
+            next unless $v->{'Type'} eq $link_meta->{'Type'};
+            next unless $v->{'Mode'} eq $link_meta->{'Mode'};
+            $objs->Limit( FIELD => 'Field', VALUE => $k );
+        }
+        push( @$list, $objs );
+    }
+
+    my %reverse = ( Base => 'Target', Target => 'Base' );
+    if ( $self->TargetURI->IsLocal ) {
+        my $objs = $self->TargetObj->Transactions;
+        $objs->Limit(
+            FIELD    => 'Type',
+            OPERATOR => '=',
+            VALUE    => 'AddLink',
+        );
+        $objs->Limit( FIELD => 'NewValue', VALUE => $self->Base );
+        while ( my ($k, $v) = each %$map ) {
+            next unless $v->{'Type'} eq $link_meta->{'Type'};
+            next unless $v->{'Mode'} eq $reverse{ $link_meta->{'Mode'} };
+            $objs->Limit( FIELD => 'Field', VALUE => $k );
+        }
+        push( @$list, $objs );
+    }
+
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON|RT::Shredder::Constants::WIPE_AFTER,
+        TargetObjects => $list,
+        Shredder => $args{'Shredder'}
+    );
+    return $self->SUPER::__DependsOn( %args );
+}
+
 sub Serialize {
     my $self = shift;
     my %args = (@_);
diff --git a/lib/RT/Principal.pm b/lib/RT/Principal.pm
index 0b120db..8cf509d 100644
--- a/lib/RT/Principal.pm
+++ b/lib/RT/Principal.pm
@@ -826,6 +826,50 @@ sub _CoreAccessible {
  }
 };
 
+
+sub __DependsOn {
+    my $self = shift;
+    my %args = (
+        Shredder => undef,
+        Dependencies => undef,
+        @_,
+    );
+    my $deps = $args{'Dependencies'};
+    my $list = [];
+
+# Group or User
+# Could be wiped allready
+    my $obj = $self->Object;
+    if( defined $obj->id ) {
+        push( @$list, $obj );
+    }
+
+# Access Control List
+    my $objs = RT::ACL->new( $self->CurrentUser );
+    $objs->Limit(
+        FIELD => 'PrincipalId',
+        OPERATOR        => '=',
+        VALUE           => $self->Id
+    );
+    push( @$list, $objs );
+
+# AddWatcher/DelWatcher txns
+    foreach my $type ( qw(AddWatcher DelWatcher) ) {
+        my $objs = RT::Transactions->new( $self->CurrentUser );
+        $objs->Limit( FIELD => $type =~ /Add/? 'NewValue': 'OldValue', VALUE => $self->Id );
+        $objs->Limit( FIELD => 'Type', VALUE => $type );
+        push( @$list, $objs );
+    }
+
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON,
+        TargetObjects => $list,
+        Shredder => $args{'Shredder'}
+    );
+    return $self->SUPER::__DependsOn( %args );
+}
+
 RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Queue.pm b/lib/RT/Queue.pm
index a60c18f..6e2bc8d 100644
--- a/lib/RT/Queue.pm
+++ b/lib/RT/Queue.pm
@@ -1145,6 +1145,53 @@ sub FindDependencies {
     $deps->Add( in => $objs );
 }
 
+sub __DependsOn {
+    my $self = shift;
+    my %args = (
+        Shredder => undef,
+        Dependencies => undef,
+        @_,
+    );
+    my $deps = $args{'Dependencies'};
+    my $list = [];
+
+# Tickets
+    my $objs = RT::Tickets->new( $self->CurrentUser );
+    $objs->{'allow_deleted_search'} = 1;
+    $objs->Limit( FIELD => 'Queue', VALUE => $self->Id );
+    push( @$list, $objs );
+
+# Queue role groups( Cc, AdminCc )
+    $objs = RT::Groups->new( $self->CurrentUser );
+    $objs->Limit( FIELD => 'Domain', VALUE => 'RT::Queue-Role', CASESENSITIVE => 0 );
+    $objs->Limit( FIELD => 'Instance', VALUE => $self->Id );
+    push( @$list, $objs );
+
+# Scrips
+    $objs = RT::Scrips->new( $self->CurrentUser );
+    $objs->LimitToQueue( $self->id );
+    push( @$list, $objs );
+
+# Templates
+    $objs = $self->Templates;
+    push( @$list, $objs );
+
+# Custom Fields
+    $objs = RT::CustomFields->new( $self->CurrentUser );
+    $objs->SetContextObject( $self );
+    $objs->LimitToQueue( $self->id );
+    push( @$list, $objs );
+
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON,
+        TargetObjects => $list,
+        Shredder => $args{'Shredder'}
+    );
+    return $self->SUPER::__DependsOn( %args );
+}
+
+
 sub PreInflate {
     my $class = shift;
     my ($importer, $uid, $data) = @_;
diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index a449998..d65ecab 100644
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -75,6 +75,7 @@ require RT::User;
 require RT::Attributes;
 require RT::Transactions;
 require RT::Link;
+use RT::Shredder::Dependencies;
 use RT::Shredder::Constants;
 use RT::Shredder::Exceptions;
 
diff --git a/lib/RT/Scrip.pm b/lib/RT/Scrip.pm
index e1b5d5f..5bd86e0 100644
--- a/lib/RT/Scrip.pm
+++ b/lib/RT/Scrip.pm
@@ -1120,6 +1120,30 @@ sub FindDependencies {
     $deps->Add( out => $self->TemplateObj );
 }
 
+sub __DependsOn {
+    my $self = shift;
+    my %args = (
+        Shredder => undef,
+        Dependencies => undef,
+        @_,
+    );
+    my $deps = $args{'Dependencies'};
+    my $list = [];
+
+    my $objs = RT::ObjectScrips->new( $self->CurrentUser );
+    $objs->LimitToScrip( $self->Id );
+    push @$list, $objs;
+
+    $deps->_PushDependencies(
+        BaseObject    => $self,
+        Flags         => RT::Shredder::Constants::DEPENDS_ON,
+        TargetObjects => $list,
+        Shredder      => $args{'Shredder'}
+    );
+
+    return $self->SUPER::__DependsOn( %args );
+}
+
 sub Serialize {
     my $self = shift;
     my %args = (@_);
diff --git a/lib/RT/ScripAction.pm b/lib/RT/ScripAction.pm
index c1c3f64..428ad5d 100644
--- a/lib/RT/ScripAction.pm
+++ b/lib/RT/ScripAction.pm
@@ -355,6 +355,28 @@ sub PreInflate {
     return not $importer->SkipBy( "Name", $class, $uid, $data );
 }
 
+sub __DependsOn {
+    my $self = shift;
+    my %args = (
+        Shredder => undef,
+        Dependencies => undef,
+        @_,
+    );
+    my $deps = $args{'Dependencies'};
+
+# Scrips
+    my $objs = RT::Scrips->new( $self->CurrentUser );
+    $objs->Limit( FIELD => 'ScripAction', VALUE => $self->Id );
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON,
+        TargetObjects => $objs,
+        Shredder => $args{'Shredder'}
+    );
+
+    return $self->SUPER::__DependsOn( %args );
+}
+
 RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/ScripCondition.pm b/lib/RT/ScripCondition.pm
index a268d60..46110a9 100644
--- a/lib/RT/ScripCondition.pm
+++ b/lib/RT/ScripCondition.pm
@@ -376,6 +376,28 @@ sub PreInflate {
     return not $importer->SkipBy( "Name", $class, $uid, $data );
 }
 
+sub __DependsOn {
+    my $self = shift;
+    my %args = (
+        Shredder => undef,
+        Dependencies => undef,
+        @_,
+    );
+    my $deps = $args{'Dependencies'};
+
+# Scrips
+    my $objs = RT::Scrips->new( $self->CurrentUser );
+    $objs->Limit( FIELD => 'ScripCondition', VALUE => $self->Id );
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON,
+        TargetObjects => $objs,
+        Shredder => $args{'Shredder'}
+    );
+
+    return $self->SUPER::__DependsOn( %args );
+}
+
 RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Shredder.pm b/lib/RT/Shredder.pm
index 6f37334..af675bd 100644
--- a/lib/RT/Shredder.pm
+++ b/lib/RT/Shredder.pm
@@ -223,24 +223,6 @@ BEGIN {
 ### after:     push @INC, qw(@RT_LIB_PATH@);
     use RT::Shredder::Constants;
     use RT::Shredder::Exceptions;
-
-    require RT;
-
-    require RT::Shredder::Attachment;
-    require RT::Shredder::CachedGroupMember;
-    require RT::Shredder::CustomField;
-    require RT::Shredder::GroupMember;
-    require RT::Shredder::Group;
-    require RT::Shredder::Link;
-    require RT::Shredder::Principal;
-    require RT::Shredder::Queue;
-    require RT::Shredder::Scrip;
-    require RT::Shredder::ScripAction;
-    require RT::Shredder::ScripCondition;
-    require RT::Shredder::Template;
-    require RT::Shredder::Ticket;
-    require RT::Shredder::Transaction;
-    require RT::Shredder::User;
 }
 
 our @SUPPORTED_OBJECTS = qw(
diff --git a/lib/RT/Shredder/Attachment.pm b/lib/RT/Shredder/Attachment.pm
deleted file mode 100644
index e2c354e..0000000
--- a/lib/RT/Shredder/Attachment.pm
+++ /dev/null
@@ -1,94 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::Attachment;
-use RT::Attachment ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Exceptions;
-use RT::Shredder::Constants;
-use RT::Shredder::Dependencies;
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-            Shredder => undef,
-            Dependencies => undef,
-            @_,
-           );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-# Nested attachments
-    my $objs = RT::Attachments->new( $self->CurrentUser );
-    $objs->Limit(
-            FIELD => 'Parent',
-            OPERATOR        => '=',
-            VALUE           => $self->Id
-           );
-    $objs->Limit(
-            FIELD => 'id',
-            OPERATOR        => '!=',
-            VALUE           => $self->Id
-           );
-    push( @$list, $objs );
-
-    $deps->_PushDependencies(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON,
-            TargetObjects => $list,
-            Shredder => $args{'Shredder'}
-        );
-    return $self->SUPER::__DependsOn( %args );
-}
-
-1;
diff --git a/lib/RT/Shredder/CachedGroupMember.pm b/lib/RT/Shredder/CachedGroupMember.pm
deleted file mode 100644
index 17e4778..0000000
--- a/lib/RT/Shredder/CachedGroupMember.pm
+++ /dev/null
@@ -1,101 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::CachedGroupMember;
-use RT::CachedGroupMember ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependency;
-
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-            Shredder => undef,
-            Dependencies => undef,
-            @_,
-           );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-# deep memebership
-    my $objs = RT::CachedGroupMembers->new( $self->CurrentUser );
-    $objs->Limit( FIELD => 'Via', VALUE => $self->Id );
-    $objs->Limit( FIELD => 'id', OPERATOR => '!=', VALUE => $self->Id );
-    push( @$list, $objs );
-
-# principal lost group membership and lost some rights which he could delegate to
-# some body
-
-# XXX: Here is problem cause HasMemberRecursively would return true allways
-# cause we didn't delete anything yet. :(
-    # if pricipal is not member anymore(could be via other groups) then proceed
-    if( $self->GroupObj->Object->HasMemberRecursively( $self->MemberObj ) ) {
-        my $acl = RT::ACL->new( $self->CurrentUser );
-        $acl->LimitToPrincipal( Id => $self->GroupId );
-
-    }
-
-
-    $deps->_PushDependencies(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON,
-            TargetObjects => $list,
-            Shredder => $args{'Shredder'}
-        );
-
-    return $self->SUPER::__DependsOn( %args );
-}
-
-1;
diff --git a/lib/RT/Shredder/CustomField.pm b/lib/RT/Shredder/CustomField.pm
deleted file mode 100644
index bad4a5e..0000000
--- a/lib/RT/Shredder/CustomField.pm
+++ /dev/null
@@ -1,90 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::CustomField;
-use RT::CustomField ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependencies;
-
-#TODO: Queues if we wish export tool
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-            Shredder => undef,
-            Dependencies => undef,
-            @_,
-           );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-# Custom field values
-    push( @$list, $self->Values );
-
-# Ticket custom field values
-    my $objs = RT::ObjectCustomFieldValues->new( $self->CurrentUser );
-    $objs->LimitToCustomField( $self->Id );
-    push( @$list, $objs );
-
-    $deps->_PushDependencies(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON,
-            TargetObjects => $list,
-            Shredder => $args{'Shredder'}
-        );
-    return $self->SUPER::__DependsOn( %args );
-}
-
-1;
diff --git a/lib/RT/Shredder/Group.pm b/lib/RT/Shredder/Group.pm
deleted file mode 100644
index 37d9841..0000000
--- a/lib/RT/Shredder/Group.pm
+++ /dev/null
@@ -1,140 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::Group;
-use RT::Group ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependencies;
-
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-        Shredder => undef,
-        Dependencies => undef,
-        @_,
-    );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-# User is inconsistent without own Equivalence group
-    if( $self->Domain eq 'ACLEquivalence' ) {
-        # delete user entry after ACL equiv group
-        # in other case we will get deep recursion
-        my $objs = RT::User->new($self->CurrentUser);
-        $objs->Load( $self->Instance );
-        $deps->_PushDependency(
-                BaseObject => $self,
-                Flags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::WIPE_AFTER,
-                TargetObject => $objs,
-                Shredder => $args{'Shredder'}
-            );
-    }
-
-# Principal
-    $deps->_PushDependency(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::WIPE_AFTER,
-            TargetObject => $self->PrincipalObj,
-            Shredder => $args{'Shredder'}
-        );
-
-# Group members records
-    my $objs = RT::GroupMembers->new( $self->CurrentUser );
-    $objs->LimitToMembersOfGroup( $self->PrincipalId );
-    push( @$list, $objs );
-
-# Group member records group belongs to
-    $objs = RT::GroupMembers->new( $self->CurrentUser );
-    $objs->Limit(
-            VALUE => $self->PrincipalId,
-            FIELD => 'MemberId',
-            ENTRYAGGREGATOR => 'OR',
-            QUOTEVALUE => 0
-            );
-    push( @$list, $objs );
-
-# Cached group members records
-    push( @$list, $self->DeepMembersObj );
-
-# Cached group member records group belongs to
-    $objs = RT::GroupMembers->new( $self->CurrentUser );
-    $objs->Limit(
-            VALUE => $self->PrincipalId,
-            FIELD => 'MemberId',
-            ENTRYAGGREGATOR => 'OR',
-            QUOTEVALUE => 0
-            );
-    push( @$list, $objs );
-
-    $deps->_PushDependencies(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON,
-            TargetObjects => $list,
-            Shredder => $args{'Shredder'}
-        );
-    return $self->SUPER::__DependsOn( %args );
-}
-
-sub BeforeWipeout
-{
-    my $self = shift;
-    if( $self->Domain eq 'SystemInternal' ) {
-        RT::Shredder::Exception::Info->throw('SystemObject');
-    }
-    return $self->SUPER::BeforeWipeout( @_ );
-}
-
-1;
diff --git a/lib/RT/Shredder/GroupMember.pm b/lib/RT/Shredder/GroupMember.pm
deleted file mode 100644
index 94a535b..0000000
--- a/lib/RT/Shredder/GroupMember.pm
+++ /dev/null
@@ -1,132 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::GroupMember;
-use RT::GroupMember ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependencies;
-
-# No dependencies that should be deleted with record
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-            Shredder => undef,
-            Dependencies => undef,
-            @_,
-           );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-    my $objs = RT::CachedGroupMembers->new( $self->CurrentUser );
-    $objs->Limit( FIELD => 'MemberId', VALUE => $self->MemberId );
-    $objs->Limit( FIELD => 'ImmediateParentId', VALUE => $self->GroupId );
-    push( @$list, $objs );
-
-    # XXX: right delegations should be cleaned here
-
-    $deps->_PushDependencies(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON,
-            TargetObjects => $list,
-            Shredder => $args{'Shredder'}
-        );
-
-    my $group = $self->GroupObj->Object;
-    # XXX: If we delete member of the ticket owner role group then we should also
-    # fix ticket object, but only if we don't plan to delete group itself!
-    unless( ($group->Name || '') eq 'Owner' &&
-        ($group->Domain || '') eq 'RT::Ticket-Role' ) {
-        return $self->SUPER::__DependsOn( %args );
-    }
-
-    # we don't delete group, so we have to fix Ticket and Group
-    $deps->_PushDependencies(
-                BaseObject => $self,
-                Flags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::VARIABLE,
-                TargetObjects => $group,
-                Shredder => $args{'Shredder'}
-        );
-    $args{'Shredder'}->PutResolver(
-            BaseClass => ref $self,
-            TargetClass => ref $group,
-            Code => sub {
-                my %args = (@_);
-                my $group = $args{'TargetObject'};
-                return if $args{'Shredder'}->GetState( Object => $group )
-                    & (RT::Shredder::Constants::WIPED|RT::Shredder::Constants::IN_WIPING);
-                return unless ($group->Name || '') eq 'Owner';
-                return unless ($group->Domain || '') eq 'RT::Ticket-Role';
-
-                return if $group->MembersObj->Count > 1;
-
-                my $group_member = $args{'BaseObject'};
-
-                if( $group_member->MemberObj->id == RT->Nobody->id ) {
-                    RT::Shredder::Exception->throw( "Couldn't delete Nobody from owners role group" );
-                }
-
-                my( $status, $msg ) = $group->AddMember( RT->Nobody->id );
-
-                RT::Shredder::Exception->throw( $msg ) unless $status;
-
-                return;
-            },
-        );
-
-    return $self->SUPER::__DependsOn( %args );
-}
-
-1;
diff --git a/lib/RT/Shredder/Link.pm b/lib/RT/Shredder/Link.pm
deleted file mode 100644
index b0e61c2..0000000
--- a/lib/RT/Shredder/Link.pm
+++ /dev/null
@@ -1,121 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::Link;
-use RT::Link ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependencies;
-use RT::Shredder::Constants;
-
-use RT::Shredder::Transaction;
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-            Shredder => undef,
-            Dependencies => undef,
-            @_,
-           );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-# AddLink transactions
-    my $map = { %RT::Link::TYPEMAP };
-    my $link_meta = $map->{ $self->Type };
-    unless ( $link_meta && $link_meta->{'Mode'} && $link_meta->{'Type'} ) {
-        RT::Shredder::Exception->throw( 'Wrong link link_meta, no record for '. $self->Type );
-    }
-    if ( $self->BaseURI->IsLocal ) {
-        my $objs = $self->BaseObj->Transactions;
-        $objs->Limit(
-            FIELD    => 'Type',
-            OPERATOR => '=',
-            VALUE    => 'AddLink',
-        );
-        $objs->Limit( FIELD => 'NewValue', VALUE => $self->Target );
-        while ( my ($k, $v) = each %$map ) {
-            next unless $v->{'Type'} eq $link_meta->{'Type'};
-            next unless $v->{'Mode'} eq $link_meta->{'Mode'};
-            $objs->Limit( FIELD => 'Field', VALUE => $k );
-        }
-        push( @$list, $objs );
-    }
-
-    my %reverse = ( Base => 'Target', Target => 'Base' );
-    if ( $self->TargetURI->IsLocal ) {
-        my $objs = $self->TargetObj->Transactions;
-        $objs->Limit(
-            FIELD    => 'Type',
-            OPERATOR => '=',
-            VALUE    => 'AddLink',
-        );
-        $objs->Limit( FIELD => 'NewValue', VALUE => $self->Base );
-        while ( my ($k, $v) = each %$map ) {
-            next unless $v->{'Type'} eq $link_meta->{'Type'};
-            next unless $v->{'Mode'} eq $reverse{ $link_meta->{'Mode'} };
-            $objs->Limit( FIELD => 'Field', VALUE => $k );
-        }
-        push( @$list, $objs );
-    }
-
-    $deps->_PushDependencies(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON|RT::Shredder::Constants::WIPE_AFTER,
-            TargetObjects => $list,
-            Shredder => $args{'Shredder'}
-        );
-    return $self->SUPER::__DependsOn( %args );
-}
-
-1;
diff --git a/lib/RT/Shredder/Principal.pm b/lib/RT/Shredder/Principal.pm
deleted file mode 100644
index 3abb1ba..0000000
--- a/lib/RT/Shredder/Principal.pm
+++ /dev/null
@@ -1,105 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::Principal;
-use RT::Principal ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Exceptions;
-use RT::Shredder::Constants;
-use RT::Shredder::Dependencies;
-
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-            Shredder => undef,
-            Dependencies => undef,
-            @_,
-           );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-# Group or User
-# Could be wiped allready
-    my $obj = $self->Object;
-    if( defined $obj->id ) {
-        push( @$list, $obj );
-    }
-
-# Access Control List
-    my $objs = RT::ACL->new( $self->CurrentUser );
-    $objs->Limit(
-            FIELD => 'PrincipalId',
-            OPERATOR        => '=',
-            VALUE           => $self->Id
-           );
-    push( @$list, $objs );
-
-# AddWatcher/DelWatcher txns
-    foreach my $type ( qw(AddWatcher DelWatcher) ) {
-        my $objs = RT::Transactions->new( $self->CurrentUser );
-        $objs->Limit( FIELD => $type =~ /Add/? 'NewValue': 'OldValue', VALUE => $self->Id );
-        $objs->Limit( FIELD => 'Type', VALUE => $type );
-        push( @$list, $objs );
-    }
-
-    $deps->_PushDependencies(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON,
-            TargetObjects => $list,
-            Shredder => $args{'Shredder'}
-        );
-    return $self->SUPER::__DependsOn( %args );
-}
-
-1;
diff --git a/lib/RT/Shredder/Queue.pm b/lib/RT/Shredder/Queue.pm
deleted file mode 100644
index eed42db..0000000
--- a/lib/RT/Shredder/Queue.pm
+++ /dev/null
@@ -1,107 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::Queue;
-use RT::Queue ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependencies;
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-            Shredder => undef,
-            Dependencies => undef,
-            @_,
-           );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-# Tickets
-    my $objs = RT::Tickets->new( $self->CurrentUser );
-    $objs->{'allow_deleted_search'} = 1;
-    $objs->Limit( FIELD => 'Queue', VALUE => $self->Id );
-    push( @$list, $objs );
-
-# Queue role groups( Cc, AdminCc )
-    $objs = RT::Groups->new( $self->CurrentUser );
-    $objs->Limit( FIELD => 'Domain', VALUE => 'RT::Queue-Role', CASESENSITIVE => 0 );
-    $objs->Limit( FIELD => 'Instance', VALUE => $self->Id );
-    push( @$list, $objs );
-
-# Scrips
-    $objs = RT::Scrips->new( $self->CurrentUser );
-    $objs->LimitToQueue( $self->id );
-    push( @$list, $objs );
-
-# Templates
-    $objs = $self->Templates;
-    push( @$list, $objs );
-
-# Custom Fields
-    $objs = RT::CustomFields->new( $self->CurrentUser );
-    $objs->SetContextObject( $self );
-    $objs->LimitToQueue( $self->id );
-    push( @$list, $objs );
-
-    $deps->_PushDependencies(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON,
-            TargetObjects => $list,
-            Shredder => $args{'Shredder'}
-        );
-    return $self->SUPER::__DependsOn( %args );
-}
-
-1;
diff --git a/lib/RT/Shredder/Scrip.pm b/lib/RT/Shredder/Scrip.pm
deleted file mode 100644
index 9ce7463..0000000
--- a/lib/RT/Shredder/Scrip.pm
+++ /dev/null
@@ -1,85 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::Scrip;
-use RT::Scrip ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependencies;
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-            Shredder => undef,
-            Dependencies => undef,
-            @_,
-           );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-    my $objs = RT::ObjectScrips->new( $self->CurrentUser );
-    $objs->LimitToScrip( $self->Id );
-    push @$list, $objs;
-
-    $deps->_PushDependencies(
-        BaseObject    => $self,
-        Flags         => RT::Shredder::Constants::DEPENDS_ON,
-        TargetObjects => $list,
-        Shredder      => $args{'Shredder'}
-    );
-
-    return $self->SUPER::__DependsOn( %args );
-}
-
-1;
diff --git a/lib/RT/Shredder/ScripAction.pm b/lib/RT/Shredder/ScripAction.pm
deleted file mode 100644
index 5b578b7..0000000
--- a/lib/RT/Shredder/ScripAction.pm
+++ /dev/null
@@ -1,84 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::ScripAction;
-use RT::ScripAction ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependencies;
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-            Shredder => undef,
-            Dependencies => undef,
-            @_,
-           );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-# Scrips
-    my $objs = RT::Scrips->new( $self->CurrentUser );
-    $objs->Limit( FIELD => 'ScripAction', VALUE => $self->Id );
-    $deps->_PushDependencies(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON,
-            TargetObjects => $objs,
-            Shredder => $args{'Shredder'}
-        );
-
-    return $self->SUPER::__DependsOn( %args );
-}
-
-1;
diff --git a/lib/RT/Shredder/ScripCondition.pm b/lib/RT/Shredder/ScripCondition.pm
deleted file mode 100644
index bdff8e2..0000000
--- a/lib/RT/Shredder/ScripCondition.pm
+++ /dev/null
@@ -1,84 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::ScripCondition;
-use RT::ScripCondition ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependencies;
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-            Shredder => undef,
-            Dependencies => undef,
-            @_,
-           );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-# Scrips
-    my $objs = RT::Scrips->new( $self->CurrentUser );
-    $objs->Limit( FIELD => 'ScripCondition', VALUE => $self->Id );
-    $deps->_PushDependencies(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON,
-            TargetObjects => $objs,
-            Shredder => $args{'Shredder'}
-        );
-
-    return $self->SUPER::__DependsOn( %args );
-}
-
-1;
diff --git a/lib/RT/Shredder/Template.pm b/lib/RT/Shredder/Template.pm
deleted file mode 100644
index 7ca4b3d..0000000
--- a/lib/RT/Shredder/Template.pm
+++ /dev/null
@@ -1,84 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::Template;
-use RT::Template ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependencies;
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-            Shredder => undef,
-            Dependencies => undef,
-            @_,
-           );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-# Scrips
-    push( @$list, $self->UsedBy );
-
-    $deps->_PushDependencies(
-        BaseObject => $self,
-        Flags => RT::Shredder::Constants::DEPENDS_ON,
-        TargetObjects => $list,
-        Shredder => $args{'Shredder'},
-    );
-
-    return $self->SUPER::__DependsOn( %args );
-}
-
-1;
diff --git a/lib/RT/Shredder/Ticket.pm b/lib/RT/Shredder/Ticket.pm
deleted file mode 100644
index 598b465..0000000
--- a/lib/RT/Shredder/Ticket.pm
+++ /dev/null
@@ -1,95 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::Ticket;
-use RT::Ticket ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependencies;
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-            Shredder => undef,
-            Dependencies => undef,
-            @_,
-           );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-# Tickets which were merged in
-    my $objs = RT::Tickets->new( $self->CurrentUser );
-    $objs->{'allow_deleted_search'} = 1;
-    $objs->Limit( FIELD => 'EffectiveId', VALUE => $self->Id );
-    $objs->Limit( FIELD => 'id', OPERATOR => '!=', VALUE => $self->Id );
-    push( @$list, $objs );
-
-# Ticket role groups( Owner, Requestors, Cc, AdminCc )
-    $objs = RT::Groups->new( $self->CurrentUser );
-    $objs->Limit( FIELD => 'Domain', VALUE => 'RT::Ticket-Role', CASESENSITIVE => 0 );
-    $objs->Limit( FIELD => 'Instance', VALUE => $self->Id );
-    push( @$list, $objs );
-
-#TODO: Users, Queues if we wish export tool
-    $deps->_PushDependencies(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON,
-            TargetObjects => $list,
-            Shredder => $args{'Shredder'}
-        );
-
-    return $self->SUPER::__DependsOn( %args );
-}
-
-1;
diff --git a/lib/RT/Shredder/Transaction.pm b/lib/RT/Shredder/Transaction.pm
deleted file mode 100644
index f33fa7b..0000000
--- a/lib/RT/Shredder/Transaction.pm
+++ /dev/null
@@ -1,82 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::Transaction;
-use RT::Transaction ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependencies;
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-            Shredder => undef,
-            Dependencies => undef,
-            @_,
-           );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-# Attachments
-    $deps->_PushDependencies(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON,
-            TargetObjects => $self->Attachments,
-            Shredder => $args{'Shredder'}
-        );
-
-    return $self->SUPER::__DependsOn( %args );
-}
-
-1;
diff --git a/lib/RT/Shredder/User.pm b/lib/RT/Shredder/User.pm
deleted file mode 100644
index 7a83c16..0000000
--- a/lib/RT/Shredder/User.pm
+++ /dev/null
@@ -1,156 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
-
-package RT::User;
-use RT::User ();
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependencies;
-
-my @OBJECTS = qw(
-    ACL
-    Articles
-    Attachments
-    Attributes
-    CachedGroupMembers
-    Classes
-    CustomFieldValues
-    CustomFields
-    GroupMembers
-    Groups
-    Links
-    ObjectClasses
-    ObjectCustomFieldValues
-    ObjectCustomFields
-    ObjectScrips
-    Principals
-    Queues
-    ScripActions
-    ScripConditions
-    Scrips
-    Templates
-    Tickets
-    Transactions
-    Users
-);
-
-sub __DependsOn
-{
-    my $self = shift;
-    my %args = (
-            Shredder => undef,
-            Dependencies => undef,
-            @_,
-           );
-    my $deps = $args{'Dependencies'};
-    my $list = [];
-
-# Principal
-    $deps->_PushDependency(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::WIPE_AFTER,
-            TargetObject => $self->PrincipalObj,
-            Shredder => $args{'Shredder'}
-        );
-
-# ACL equivalence group
-# don't use LoadACLEquivalenceGroup cause it may not exists any more
-    my $objs = RT::Groups->new( $self->CurrentUser );
-    $objs->Limit( FIELD => 'Domain', VALUE => 'ACLEquivalence', CASESENSITIVE => 0 );
-    $objs->Limit( FIELD => 'Instance', VALUE => $self->Id );
-    push( @$list, $objs );
-
-# Cleanup user's membership
-    $objs = RT::GroupMembers->new( $self->CurrentUser );
-    $objs->Limit( FIELD => 'MemberId', VALUE => $self->Id );
-    push( @$list, $objs );
-
-    $deps->_PushDependencies(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON,
-            TargetObjects => $list,
-            Shredder => $args{'Shredder'}
-        );
-
-# TODO: Almost all objects has Creator, LastUpdatedBy and etc. fields
-# which are references on users(Principal actualy)
-    my @var_objs;
-    foreach( @OBJECTS ) {
-        my $class = "RT::$_";
-        foreach my $method ( qw(Creator LastUpdatedBy) ) {
-            my $objs = $class->new( $self->CurrentUser );
-            next unless $objs->RecordClass->_Accessible( $method => 'read' );
-            $objs->Limit( FIELD => $method, VALUE => $self->id );
-            push @var_objs, $objs;
-        }
-    }
-    $deps->_PushDependencies(
-            BaseObject => $self,
-            Flags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::VARIABLE,
-            TargetObjects => \@var_objs,
-            Shredder => $args{'Shredder'}
-        );
-
-    return $self->SUPER::__DependsOn( %args );
-}
-
-sub BeforeWipeout
-{
-    my $self = shift;
-    if( $self->Name =~ /^(RT_System|Nobody)$/ ) {
-        RT::Shredder::Exception::Info->throw('SystemObject');
-    }
-    return $self->SUPER::BeforeWipeout( @_ );
-}
-
-1;
diff --git a/lib/RT/Template.pm b/lib/RT/Template.pm
index dad41f7..4b55443 100644
--- a/lib/RT/Template.pm
+++ b/lib/RT/Template.pm
@@ -1046,6 +1046,29 @@ sub FindDependencies {
     $deps->Add( out => $self->QueueObj ) if $self->QueueObj->Id;
 }
 
+sub __DependsOn {
+    my $self = shift;
+    my %args = (
+        Shredder => undef,
+        Dependencies => undef,
+        @_,
+    );
+    my $deps = $args{'Dependencies'};
+    my $list = [];
+
+# Scrips
+    push( @$list, $self->UsedBy );
+
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON,
+        TargetObjects => $list,
+        Shredder => $args{'Shredder'},
+    );
+
+    return $self->SUPER::__DependsOn( %args );
+}
+
 sub PreInflate {
     my $class = shift;
     my ($importer, $uid, $data) = @_;
diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
index 3822761..388579d 100644
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -3614,6 +3614,40 @@ sub FindDependencies {
     $deps->Add( out => $self->OwnerObj );
 }
 
+sub __DependsOn {
+    my $self = shift;
+    my %args = (
+        Shredder => undef,
+        Dependencies => undef,
+        @_,
+    );
+    my $deps = $args{'Dependencies'};
+    my $list = [];
+
+# Tickets which were merged in
+    my $objs = RT::Tickets->new( $self->CurrentUser );
+    $objs->{'allow_deleted_search'} = 1;
+    $objs->Limit( FIELD => 'EffectiveId', VALUE => $self->Id );
+    $objs->Limit( FIELD => 'id', OPERATOR => '!=', VALUE => $self->Id );
+    push( @$list, $objs );
+
+# Ticket role groups( Owner, Requestors, Cc, AdminCc )
+    $objs = RT::Groups->new( $self->CurrentUser );
+    $objs->Limit( FIELD => 'Domain', VALUE => 'RT::Ticket-Role', CASESENSITIVE => 0 );
+    $objs->Limit( FIELD => 'Instance', VALUE => $self->Id );
+    push( @$list, $objs );
+
+#TODO: Users, Queues if we wish export tool
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON,
+        TargetObjects => $list,
+        Shredder => $args{'Shredder'}
+    );
+
+    return $self->SUPER::__DependsOn( %args );
+}
+
 sub Serialize {
     my $self = shift;
     my %args = (@_);
diff --git a/lib/RT/Transaction.pm b/lib/RT/Transaction.pm
index 3b420e9..abe1c60 100644
--- a/lib/RT/Transaction.pm
+++ b/lib/RT/Transaction.pm
@@ -1919,6 +1919,25 @@ sub FindDependencies {
     }
 }
 
+sub __DependsOn {
+    my $self = shift;
+    my %args = (
+        Shredder => undef,
+        Dependencies => undef,
+        @_,
+    );
+    my $deps = $args{'Dependencies'};
+
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON,
+        TargetObjects => $self->Attachments,
+        Shredder => $args{'Shredder'}
+    );
+
+    return $self->SUPER::__DependsOn( %args );
+}
+
 sub Serialize {
     my $self = shift;
     my %args = (@_);
diff --git a/lib/RT/User.pm b/lib/RT/User.pm
index bd01bfe..e65478d 100644
--- a/lib/RT/User.pm
+++ b/lib/RT/User.pm
@@ -2700,6 +2700,99 @@ sub FindDependencies {
     # and LastUpdatedBy columns.
 }
 
+sub __DependsOn {
+    my $self = shift;
+    my %args = (
+        Shredder => undef,
+        Dependencies => undef,
+        @_,
+    );
+    my $deps = $args{'Dependencies'};
+    my $list = [];
+
+# Principal
+    $deps->_PushDependency(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::WIPE_AFTER,
+        TargetObject => $self->PrincipalObj,
+        Shredder => $args{'Shredder'}
+    );
+
+# ACL equivalence group
+# don't use LoadACLEquivalenceGroup cause it may not exists any more
+    my $objs = RT::Groups->new( $self->CurrentUser );
+    $objs->Limit( FIELD => 'Domain', VALUE => 'ACLEquivalence', CASESENSITIVE => 0 );
+    $objs->Limit( FIELD => 'Instance', VALUE => $self->Id );
+    push( @$list, $objs );
+
+# Cleanup user's membership
+    $objs = RT::GroupMembers->new( $self->CurrentUser );
+    $objs->Limit( FIELD => 'MemberId', VALUE => $self->Id );
+    push( @$list, $objs );
+
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON,
+        TargetObjects => $list,
+        Shredder => $args{'Shredder'}
+    );
+
+# TODO: Almost all objects has Creator, LastUpdatedBy and etc. fields
+# which are references on users(Principal actualy)
+    my @OBJECTS = qw(
+        ACL
+        Articles
+        Attachments
+        Attributes
+        CachedGroupMembers
+        Classes
+        CustomFieldValues
+        CustomFields
+        GroupMembers
+        Groups
+        Links
+        ObjectClasses
+        ObjectCustomFieldValues
+        ObjectCustomFields
+        ObjectScrips
+        Principals
+        Queues
+        ScripActions
+        ScripConditions
+        Scrips
+        Templates
+        Tickets
+        Transactions
+        Users
+    );
+    my @var_objs;
+    foreach( @OBJECTS ) {
+        my $class = "RT::$_";
+        foreach my $method ( qw(Creator LastUpdatedBy) ) {
+            my $objs = $class->new( $self->CurrentUser );
+            next unless $objs->RecordClass->_Accessible( $method => 'read' );
+            $objs->Limit( FIELD => $method, VALUE => $self->id );
+            push @var_objs, $objs;
+        }
+    }
+    $deps->_PushDependencies(
+        BaseObject => $self,
+        Flags => RT::Shredder::Constants::DEPENDS_ON | RT::Shredder::Constants::VARIABLE,
+        TargetObjects => \@var_objs,
+        Shredder => $args{'Shredder'}
+    );
+
+    return $self->SUPER::__DependsOn( %args );
+}
+
+sub BeforeWipeout {
+    my $self = shift;
+    if( $self->Name =~ /^(RT_System|Nobody)$/ ) {
+        RT::Shredder::Exception::Info->throw('SystemObject');
+    }
+    return $self->SUPER::BeforeWipeout( @_ );
+}
+
 sub Serialize {
     my $self = shift;
     return (

-----------------------------------------------------------------------


More information about the rt-commit mailing list