Created
June 13, 2014 20:02
-
-
Save broox9/d918b0502de69d508be0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Why are you passing it a hash?
Author
in the event that we'd have more than just two params to pass, but it's not working so I"m changing it
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
Why not just do DuplicatePromotion.perform_async(@promotion._id, new_promotion_name, duplicate_posts)