jobs: migrate mass updates to ActiveJob.
Also fixes a bug where mod actions weren't logged on mass updates. Creating the mod action silently failed because it was called when CurrentUser wasn' set.
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
module Moderator
|
||||
class TagsController < ApplicationController
|
||||
before_action :moderator_only
|
||||
rescue_from TagBatchChange::Error, :with => :error
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def update
|
||||
Delayed::Job.enqueue(TagBatchChange.new(params[:tag][:antecedent], params[:tag][:consequent], CurrentUser.user.id, CurrentUser.ip_addr), :queue => "default")
|
||||
TagBatchChangeJob.perform_later(params[:tag][:antecedent], params[:tag][:consequent], CurrentUser.user, CurrentUser.ip_addr)
|
||||
redirect_to edit_moderator_tag_path, :notice => "Post changes queued"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user