From e20ce60629e91c63d75701651c117177ce02aced Mon Sep 17 00:00:00 2001 From: Alban Peignier Date: Thu, 28 Dec 2017 12:16:19 +0100 Subject: Add log messages when Referential can't be created. Remove useless build_referenial invocation in ReferentialsController#create. Refs #5297 --- app/controllers/referentials_controller.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/controllers/referentials_controller.rb') diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb index 9dbd659da..f63abf685 100644 --- a/app/controllers/referentials_controller.rb +++ b/app/controllers/referentials_controller.rb @@ -14,15 +14,16 @@ class ReferentialsController < ChouetteController def create create! do |success, failure| - build_referenial - success.html do if @referential.created_from_id.present? flash[:notice] = t('notice.referentials.duplicate') redirect_to workbench_path(@referential.workbench) end end - failure.html { render :new } + failure.html do + Rails.logger.info "Can't create Referential : #{@referential.errors.inspect}" + render :new + end end end -- cgit v1.2.3