Skip to content

Commit

Permalink
Allow override of BatchController with customized BatchUpdateJob
Browse files Browse the repository at this point in the history
  • Loading branch information
awead authored and jcoyne committed Dec 2, 2015
1 parent d367bdc commit d08028b
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def update
@upload_set = UploadSet.find_or_create(params[:id])
@upload_set.status = ["processing"]
@upload_set.save
file_attributes = edit_form_class.model_attributes(params[:file_set])
UploadSetUpdateJob.perform_later(current_user.user_key, params[:id], params[:title], file_attributes, params[:visibility])
create_update_job
flash[:notice] = 'Your files are being processed by ' + t('curation_concerns.product_name') + ' in the background. The metadata and access controls you specified are being applied. Files will be marked <span class="label label-danger" title="Private">Private</span> until this process is complete (shouldn\'t take too long, hang in there!). You may need to refresh your dashboard to see these updates.'

redirect_to main_app.curation_concerns_generic_works_path
Expand All @@ -34,5 +33,13 @@ def edit_form
file_set = ::FileSet.new(creator: [current_user.user_key], title: @upload_set.file_sets.map(&:label))
edit_form_class.new(file_set)
end

def create_update_job
UploadSetUpdateJob.perform_later(current_user.user_key,
params[:id],
params[:title],
edit_form_class.model_attributes(params[:file_set]),
params[:visibility])
end
end
end

0 comments on commit d08028b

Please sign in to comment.