diff --git a/.gems b/.gems index 100126e..9d895b5 100644 --- a/.gems +++ b/.gems @@ -2,4 +2,5 @@ thoughtbot-clearance --version '>= 0.6.8' --source gems.github.com RedCloth --version '= 4.1.1' mislav-will_paginate --version '~> 2.3.11' --source gems.github.com ambethia-smtp-tls --version '1.1.2' --source gems.github.com +tobi-delayed_job --version '1.7.0' --source gems.github.com diff --git a/README.markdown b/README.markdown index b97f9f8..7eb9db0 100644 --- a/README.markdown +++ b/README.markdown @@ -14,6 +14,8 @@ This will create a Rails 2.3.2 app with: * Cucumber, Shoulda, Factory Girl, & Mocha for testing * Hoptoad Notifier for exception notification * Paperclip for file uploads, set for Amazon S3 +* Coulda for model, controller, & helper generators +* Delayed Job for background processing * Will Paginate for pagination * RedCloth for Textile formatting diff --git a/db/migrate/20090702053331_create_delayed_jobs.rb b/db/migrate/20090702053331_create_delayed_jobs.rb new file mode 100644 index 0000000..cd36927 --- /dev/null +++ b/db/migrate/20090702053331_create_delayed_jobs.rb @@ -0,0 +1,35 @@ +class CreateDelayedJobs < ActiveRecord::Migration + def self.up + create_table :delayed_jobs do |table| + # Allows some jobs to jump to the front of the queue + table.integer :priority, :default => 0 + + # Provides for retries, but still fail eventually. + table.integer :attempts, :default => 0 + + # YAML-encoded string of the object that will do work + table.text :handler + + # reason for last failure (See Note below) + table.string :last_error + + # When to run. Could be Time.now for immediately, or sometime in the future. + table.datetime :run_at + + # Set when a client is working on this object + table.datetime :locked_at + + # Set when all retries have failed (actually, by default, the record is deleted instead) + table.datetime :failed_at + + # Who is working on this object (if locked) + table.string :locked_by + + table.timestamps + end + end + + def self.down + drop_table :delayed_jobs + end +end -- libgit2 0.21.2