Skip to content

Commit

Permalink
Update how indexes are declared
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeepers committed Nov 5, 2010
1 parent 80f8a01 commit 48bf572
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -6,5 +6,9 @@ Add the gems to your Gemfile:

gem 'delayed_job', '2.1.0.pre2'
gem 'delayed_job_mongoid', '1.0.0.rc'


Create the indexes:

script/rails runner 'Delayed::Backend::Mongoid::Job.create_indexes'

That's it. Use [delayed_job as normal](http://github.com/collectiveidea/delayed_job).
4 changes: 3 additions & 1 deletion lib/delayed/backend/mongoid.rb
Expand Up @@ -10,11 +10,13 @@ class Job
field :handler, :type=> String
field :run_at, :type=> Time
field :locked_at, :type=> Time
field :locked_by, :type=> String, :index => true
field :locked_by, :type=> String
field :failed_at, :type=> Time
field :last_error, :type=> String


index :locked_by

before_save :set_default_run_at

def self.before_fork
Expand Down

0 comments on commit 48bf572

Please sign in to comment.