Display real error
This commit is contained in:
parent
03635cf88d
commit
3737eba6f5
@ -25,7 +25,11 @@ class AdditionalsChangeStatusController < ApplicationController
|
||||
journal: @issue.current_journal
|
||||
|
||||
if !@issue.save || issue_old_status_id == @issue.status_id
|
||||
flash[:error] = l :error_issue_status_could_not_changed
|
||||
messages = Array.wrap(@issue).map {|object| object.errors.full_messages}.flatten
|
||||
if messages.empty?
|
||||
flash[:error] = l :error_issue_status_could_not_changed
|
||||
else
|
||||
flash[:error] = messages.join(', ')
|
||||
return redirect_to(issue_path(@issue))
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user