Created
February 4, 2013 20:12
-
-
Save anonymous/4709324 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
| class BackgroundJobChecker | |
| def self.check | |
| Resque::Plugins::Status::Hash.statuses.each do |job| | |
| return !job.working? | |
| end | |
| end | |
| end |
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
| 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