From 56b9528de8c7b1871e89dc3893b1301f28c1ca96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 17 Jun 2015 15:38:45 +0200 Subject: [PATCH] FIX: catch the PG::UniqueViolation exception too --- app/jobs/regular/automatic_group_membership.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/regular/automatic_group_membership.rb b/app/jobs/regular/automatic_group_membership.rb index 0b4488371ae..ae524685cfb 100644 --- a/app/jobs/regular/automatic_group_membership.rb +++ b/app/jobs/regular/automatic_group_membership.rb @@ -14,7 +14,7 @@ module Jobs domains = group.automatic_membership_email_domains.gsub('.', '\.') User.where("email ~* '@(#{domains})$'").find_each do |user| - group.add(user) rescue ActiveRecord::RecordNotUnique + group.add(user) rescue ActiveRecord::RecordNotUnique, PG::UniqueViolation end end