]> gitweb.michael.orlitzky.com - mailshears.git/blobdiff - lib/prune/prune_plugin.rb
Simplify prune plugins and fix array difference error.
[mailshears.git] / lib / prune / prune_plugin.rb
index 44fd636f20888e56c255a765aa1a354d464c7f2c..1046f2d0b29c575a8a4ecfc8c51a54f1e609e6ad 100644 (file)
@@ -20,12 +20,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.
   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.
   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
   end
 end