[refs #733] add check for correct answer
This commit is contained in:
parent
e7e80164cb
commit
663db6e7ff
|
@ -52,7 +52,9 @@ class Api::V1::BuildListsController < Api::V1::BaseController
|
|||
private
|
||||
|
||||
def render_json(action_name)
|
||||
if @build_list.send(action_name)
|
||||
if !@build_list.send "can_#{action_name}?"
|
||||
render :json => {:"is_#{action_name}ed" => false, :url => api_v1_build_list_path(@build_list, :format => :json), :message => "Incorrect action for current status"}
|
||||
elsif @build_list.send(action_name)
|
||||
render :json => {:"is_#{action_name}ed" => true, :url => api_v1_build_list_path(@build_list, :format => :json), :message => t("layout.build_lists.#{action_name}_success")}
|
||||
else
|
||||
render :json => {:"is_#{action_name}ed" => false, :url => api_v1_build_list_path(@build_list, :format => :json), :message => t("layout.build_lists.#{action_name}_fail")}
|
||||
|
|
Loading…
Reference in New Issue