Skip to content

Instantly share code, notes, and snippets.

@broox9
Created June 13, 2014 20:02
Show Gist options
  • Select an option

  • Save broox9/d918b0502de69d508be0 to your computer and use it in GitHub Desktop.

Select an option

Save broox9/d918b0502de69d508be0 to your computer and use it in GitHub Desktop.
def duplicate
h = {}
h['new_promotion_name'] = params[:new_promotion_name]
h['duplicate_posts'] = params[:duplicate_posts]
h['promotion_id'] = @promotion._id
DuplicatePromotion.perform_async(h)
#Rails.logger.debug "******************** DUPLICATE JOB !!!! #{job_id}*************************"
flash[:notice] = "#{@promotion.name} was duplicated."
redirect_to promotions_path
end
@jeremyhaile
Copy link

Why not just do DuplicatePromotion.perform_async(@promotion._id, new_promotion_name, duplicate_posts)

@jeremyhaile
Copy link

Why are you passing it a hash?

@broox9
Copy link
Author

broox9 commented Jun 13, 2014

in the event that we'd have more than just two params to pass, but it's not working so I"m changing it

@jeremyhaile
Copy link

OK - yeah...you should be able to just pass it arguments like you would any other method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment