From 58396da9ae8c73faa1eac3e360422b3bc541a717 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 17 Feb 2016 15:15:26 +0100 Subject: [PATCH] Added mysql error message. --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 665abdbed..cd24f1a39 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -393,7 +393,7 @@ class ApplicationController < ActionController::Base data = { error: error } - if error =~ /(already exists|duplicate key)/i + if error =~ /(already exists|duplicate key|duplicate entry)/i data[:error_human] = 'Object already exists!' end data