FIX: catch the PG::UniqueViolation exception too

This commit is contained in:
Régis Hanol 2015-06-17 15:38:45 +02:00
parent 1aa7cf842a
commit 56b9528de8
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ module Jobs
domains = group.automatic_membership_email_domains.gsub('.', '\.') domains = group.automatic_membership_email_domains.gsub('.', '\.')
User.where("email ~* '@(#{domains})$'").find_each do |user| User.where("email ~* '@(#{domains})$'").find_each do |user|
group.add(user) rescue ActiveRecord::RecordNotUnique group.add(user) rescue ActiveRecord::RecordNotUnique, PG::UniqueViolation
end end
end end