[Rt-commit] rt branch, 4.2/merge-shredder-overlays, created. rt-4.2.4-42-gc9957b5

Alex Vandiver alexmv at bestpractical.com
Fri May 23 20:16:11 EDT 2014


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

- Log -----------------------------------------------------------------
commit a4ccd1faf0989ac24ff156a31120f795dcfda2a4
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 dcb0003..39a4646 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 8c2f2a293ed70c5a97178f1d834445420a07e7fb
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 39a4646..75769d0 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 5eb3f35a357cf015d9f6c07fba5b32e7d93ca991
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 fa47b3a..fecd657 100644
--- a/lib/RT/Shredder.pm
+++ b/lib/RT/Shredder.pm
@@ -432,7 +432,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 => '' )
@@ -554,7 +557,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'} );
     }
 }
@@ -586,9 +589,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' );
@@ -599,25 +602,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 737dacf..18e46c2 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 ffd4165..580cd7d 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 7ad2869..e86da38 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 75769d0..890381e 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 125d103..73c9903 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 fdfcb8b..7318677 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 00dea55..988617f 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 f1fe7e7..a1617d2 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 b9a7e08..f2b2d3b 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 a561db9..fca660f 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 e51f223..49127c1 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 d95c213..5b53334 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 ebfa7c2..623ab25 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 c4953c6..8706a6a 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 1bb94b8..78b58ef 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 cec8bec..d0e339e 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 b606a64..cd4b01d 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 b1b39a2..8043eac 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 b4f00ba..9d530c1 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 41f3d02..3a51a03 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 a29baaab128f56eb469c46c5d0ab8c8ea07a4648
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 fecd657..4f86301 100644
--- a/lib/RT/Shredder.pm
+++ b/lib/RT/Shredder.pm
@@ -364,7 +364,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;
@@ -431,7 +438,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
@@ -463,7 +470,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 988617f..5509171 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 a81b1f0..8cf1140 100644
--- a/lib/RT/Shredder/Plugin/Summary.pm
+++ b/lib/RT/Shredder/Plugin/Summary.pm
@@ -115,7 +115,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 );
 }
@@ -154,7 +154,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;
 }
@@ -171,7 +171,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 623ab25..042a4a7 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 6afa13e..82ccee7 100644
--- a/sbin/rt-shredder.in
+++ b/sbin/rt-shredder.in
@@ -184,7 +184,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 20d0e02..7654518 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 8702baaa6772950166b3d6e366c8f6e5c36afe9d
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 b000209..6d009c5 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;
 use Encode qw();
 
 our $_TABLE_ATTR = { };
@@ -2507,6 +2509,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 4f86301..a79f4a9 100644
--- a/lib/RT/Shredder.pm
+++ b/lib/RT/Shredder.pm
@@ -224,8 +224,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 fca660f..320d5b4 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
 {
diff --git a/lib/RT/Shredder/Record.pm b/lib/RT/Shredder/Record.pm
deleted file mode 100644
index 042a4a7..0000000
--- a/lib/RT/Shredder/Record.pm
+++ /dev/null
@@ -1,174 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::Record ();
-package RT::Record;
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-
-=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;
-}
-
-1;

commit 5486169cf746bb425b437269e0625e0c5b565c00
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 3a51a03..7e92bd4 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 1a0aa7662b04dbca024a2b46497eae53d31ac7e4
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 a79f4a9..5563398 100644
--- a/lib/RT/Shredder.pm
+++ b/lib/RT/Shredder.pm
@@ -224,11 +224,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;
@@ -238,7 +236,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 18e46c2..0000000
--- a/lib/RT/Shredder/ACE.pm
+++ /dev/null
@@ -1,81 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::ACE ();
-package 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 08e19ae..0000000
--- a/lib/RT/Shredder/CustomFieldValue.pm
+++ /dev/null
@@ -1,64 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::CustomFieldValue ();
-package 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 440645e..0000000
--- a/lib/RT/Shredder/ObjectCustomFieldValue.pm
+++ /dev/null
@@ -1,60 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::ObjectCustomFieldValue ();
-package RT::ObjectCustomFieldValue;
-
-use strict;
-use warnings;
-use warnings FATAL => 'redefine';
-
-use RT::Shredder::Constants;
-use RT::Shredder::Exceptions;
-use RT::Shredder::Dependencies;
-
-1;

commit c9957b5944952397c9ffc50ab3a87bd709603ae9
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 f4d1d73..3a5ddfd 100644
--- a/lib/RT/Attachment.pm
+++ b/lib/RT/Attachment.pm
@@ -1101,6 +1101,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 17e4842..ebc345b 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 fdc66a2..c6457be 100644
--- a/lib/RT/CustomField.pm
+++ b/lib/RT/CustomField.pm
@@ -2161,6 +2161,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 f38f7a1..479091e 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 26d62e3..d7ba65a 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 0418b8f..f643050 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 fe8a25a..ba054fc 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 0a642bf..050b390 100644
--- a/lib/RT/Queue.pm
+++ b/lib/RT/Queue.pm
@@ -1141,6 +1141,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 6d009c5..1cd7542 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;
 use Encode qw();
diff --git a/lib/RT/Scrip.pm b/lib/RT/Scrip.pm
index 859c1fa..a06ae5e 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 PreInflate {
     my $class = shift;
     my ($importer, $uid, $data) = @_;
diff --git a/lib/RT/ScripAction.pm b/lib/RT/ScripAction.pm
index feb1b2c..02928c1 100644
--- a/lib/RT/ScripAction.pm
+++ b/lib/RT/ScripAction.pm
@@ -354,6 +354,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 8a59c1f..a5fcf7f 100644
--- a/lib/RT/ScripCondition.pm
+++ b/lib/RT/ScripCondition.pm
@@ -375,6 +375,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 5563398..04b364d 100644
--- a/lib/RT/Shredder.pm
+++ b/lib/RT/Shredder.pm
@@ -221,24 +221,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 580cd7d..0000000
--- a/lib/RT/Shredder/Attachment.pm
+++ /dev/null
@@ -1,94 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::Attachment ();
-package 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 e86da38..0000000
--- a/lib/RT/Shredder/CachedGroupMember.pm
+++ /dev/null
@@ -1,101 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::CachedGroupMember ();
-package 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 73c9903..0000000
--- a/lib/RT/Shredder/CustomField.pm
+++ /dev/null
@@ -1,90 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::CustomField ();
-package 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 a1617d2..0000000
--- a/lib/RT/Shredder/Group.pm
+++ /dev/null
@@ -1,140 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::Group ();
-package 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 f2b2d3b..0000000
--- a/lib/RT/Shredder/GroupMember.pm
+++ /dev/null
@@ -1,132 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::GroupMember ();
-package 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 320d5b4..0000000
--- a/lib/RT/Shredder/Link.pm
+++ /dev/null
@@ -1,121 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::Link ();
-package 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 49127c1..0000000
--- a/lib/RT/Shredder/Principal.pm
+++ /dev/null
@@ -1,105 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::Principal ();
-package 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 5b53334..0000000
--- a/lib/RT/Shredder/Queue.pm
+++ /dev/null
@@ -1,107 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::Queue ();
-package 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 8706a6a..0000000
--- a/lib/RT/Shredder/Scrip.pm
+++ /dev/null
@@ -1,85 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::Scrip ();
-package 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 78b58ef..0000000
--- a/lib/RT/Shredder/ScripAction.pm
+++ /dev/null
@@ -1,84 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::ScripAction ();
-package 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 d0e339e..0000000
--- a/lib/RT/Shredder/ScripCondition.pm
+++ /dev/null
@@ -1,84 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::ScripCondition ();
-package 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 cd4b01d..0000000
--- a/lib/RT/Shredder/Template.pm
+++ /dev/null
@@ -1,84 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::Template ();
-package 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 8043eac..0000000
--- a/lib/RT/Shredder/Ticket.pm
+++ /dev/null
@@ -1,95 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::Ticket ();
-package 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 9d530c1..0000000
--- a/lib/RT/Shredder/Transaction.pm
+++ /dev/null
@@ -1,82 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::Transaction ();
-package 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 7e92bd4..0000000
--- a/lib/RT/Shredder/User.pm
+++ /dev/null
@@ -1,156 +0,0 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2014 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 }}}
-
-use RT::User ();
-package 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 3831f4f..045e4d4 100644
--- a/lib/RT/Template.pm
+++ b/lib/RT/Template.pm
@@ -1041,6 +1041,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 46577e4..861dca9 100644
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -3612,6 +3612,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 68c7cd2..1001b8a 100644
--- a/lib/RT/Transaction.pm
+++ b/lib/RT/Transaction.pm
@@ -1899,6 +1899,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 1d6bee7..6b7f4eb 100644
--- a/lib/RT/User.pm
+++ b/lib/RT/User.pm
@@ -2725,6 +2725,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