Skip to content

Instantly share code, notes, and snippets.

Created February 4, 2013 20:12
Show Gist options
  • Select an option

  • Save anonymous/4709324 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/4709324 to your computer and use it in GitHub Desktop.
class BackgroundJobChecker
def self.check
Resque::Plugins::Status::Hash.statuses.each do |job|
return !job.working?
end
end
end
require "background_job_checker"
class Device < ActiveRecord::Base
before_create BackgroundJobChecker::check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment