]> gitweb.michael.orlitzky.com - mailshears.git/blobdiff - lib/prune/prune_plugin.rb
Fix variable names in the prune tests.
[mailshears.git] / lib / prune / prune_plugin.rb
index 44fd636f20888e56c255a765aa1a354d464c7f2c..4757c028780baa972e84891032cf484ad596374a 100644 (file)
@@ -6,7 +6,6 @@ module PrunePlugin
   # i.e. after an user has been removed from the PostfixAdmin
   # database.
   #
-  include RmPlugin
   extend Plugin::Run
 
   def self.runner()
@@ -20,12 +19,16 @@ module PrunePlugin
   def get_leftover_domains(db_domains)
     # Given a list of domains, determine which domains belonging to
     # this plugin are not contained in the given list.
-    raise NotImplementedError
+
+    # WARNING! Array difference doesn't work for some reason.
+    return list_domains().select{ |d| !db_domains.include?(d) }
   end
 
   def get_leftover_users(db_users)
     # Given a list of users, determine which users belonging to
     # this plugin are not contained in the given list.
-    raise NotImplementedError
+
+    # WARNING! Array difference doesn't work for some reason.
+    return list_users().select{ |u| !db_users.include?(u) }
   end
 end