[#135] set rejector in api & small controllers refactoring

This commit is contained in:
Alexander Machehin 2013-05-30 16:41:09 +06:00
parent afd24a65f5
commit b9a8464307
2 changed files with 2 additions and 3 deletions

View File

@ -34,11 +34,11 @@ class Api::V1::BuildListsController < Api::V1::BaseController
def publish
@build_list.publisher = current_user
@build_list.save
render_json :publish
end
def reject_publish
@build_list.publisher = current_user
render_json :reject_publish
end

View File

@ -171,11 +171,10 @@ class Projects::BuildListsController < Projects::BaseController
redirect_to :back, :notice => t('layout.build_lists.publish_fail') and return
end
end
end
@build_list.publisher = current_user
if @build_list.save && @build_list.can_publish? && @build_list.now_publish
if @build_list.publish
redirect_to :back, :notice => t('layout.build_lists.publish_success')
else
redirect_to :back, :notice => t('layout.build_lists.publish_fail')