Permalink
Browse files

add a script for remove duplicate membership

  • Loading branch information...
1 parent fc2bf50 commit ec89c90724282acf228c721fe18f8bcae7e18bd0 @szpyxlwoni szpyxlwoni committed Nov 22, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 script/remove_dup_membership.rb
@@ -0,0 +1,7 @@
+h = Hash.new
+Membership.find(:all).each{|membership|
+ if mem = h[[membership.person_id,membership.team_id]]
+ Membership.destroy(mem)
+ end
+ h[[membership.person_id,membership.team_id]] = membership
+}

0 comments on commit ec89c90

Please sign in to comment.