Permalink
Browse files

Fix to support Mongoid 3.0.x

An error was occurring due to the object id not being converted to a string when scheduling.  Added a "to_s" call to make sure that the id is in fact a string when scheduling the delayed task.

Signed-off-by: JD Hendrickson <jd@digitalopera.com>
  • Loading branch information...
1 parent bff3291 commit 8b9e48ee60b7687afbc0a8584a760bd226cdfad5 @noiseunion noiseunion committed Jul 20, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/backgrounder/orm/base.rb
@@ -51,13 +51,13 @@ def set_#{column}_processing
def enqueue_#{column}_background_job
if defined? ::GirlFriday
- CARRIERWAVE_QUEUE << { :worker => #{worker}.new(self.class.name, id, #{column}.mounted_as) }
+ CARRIERWAVE_QUEUE << { :worker => #{worker}.new(self.class.name, id.to_s, #{column}.mounted_as) }
elsif defined? ::Delayed::Job
- ::Delayed::Job.enqueue #{worker}.new(self.class.name, id, #{column}.mounted_as)
+ ::Delayed::Job.enqueue #{worker}.new(self.class.name, id.to_s, #{column}.mounted_as)
elsif defined? ::Resque
- ::Resque.enqueue #{worker}, self.class.name, id, #{column}.mounted_as
+ ::Resque.enqueue #{worker}, self.class.name, id.to_s, #{column}.mounted_as
elsif defined? ::Qu
- ::Qu.enqueue #{worker}, self.class.name, id, #{column}.mounted_as
+ ::Qu.enqueue #{worker}, self.class.name, id.to_s, #{column}.mounted_as
end
end

0 comments on commit 8b9e48e

Please sign in to comment.