Sha256: b2c935015e578957d3e149d2ef9796757545b0cc44ce5fef361ae69ce8f30d8c

Contents?: true

Size: 923 Bytes

Versions: 17

Compression:

Stored size: 923 Bytes

Contents

require 'active_record'

ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
ActiveRecord::Base.logger = Delayed::Worker.logger
ActiveRecord::Migration.verbose = false

ActiveRecord::Schema.define do
  create_table :delayed_jobs, :force => true do |table|
    table.integer  :priority, :default => 0
    table.integer  :attempts, :default => 0
    table.text     :handler
    table.text     :last_error
    table.datetime :run_at
    table.datetime :locked_at
    table.datetime :failed_at
    table.string   :locked_by
    table.timestamps
  end

  add_index :delayed_jobs, [:priority, :run_at], :name => 'delayed_jobs_priority'

  create_table :stories, :force => true do |table|
    table.string :text
  end
end

# Purely useful for test cases...
class Story < ActiveRecord::Base
  def tell; text; end       
  def whatever(n, _); tell*n; end
  
  handle_asynchronously :whatever
end

Version data entries

17 entries across 17 versions & 6 rubygems

Version Path
delayed_job-2.0.8 spec/setup/active_record.rb
delayed_job_csi-2.0.7 spec/setup/active_record.rb
yetanothernguyen-delayed_job-0.0.1 spec/setup/active_record.rb
delayed_job-2.0.7 spec/setup/active_record.rb
emipair-delayed_job-2.0.3.1 spec/setup/active_record.rb
delayed_job-2.0.6 spec/setup/active_record.rb
delayed_job-2.0.5 spec/setup/active_record.rb
delayed_job-2.0.4 spec/setup/active_record.rb
jmcnevin-delayed_job-2.0.6 spec/setup/active_record.rb
jmcnevin-delayed_job-2.0.5 spec/setup/active_record.rb
jmcnevin-delayed_job-2.0.4 spec/setup/active_record.rb
opsb-delayed_job-2.0.3 spec/setup/active_record.rb
delayed_job-2.1.0.pre spec/setup/active_record.rb
delayed_job-2.0.3 spec/setup/active_record.rb
delayed_job-2.0.2 spec/setup/active_record.rb
delayed_job-2.0.1 spec/setup/active_record.rb
delayed_job-2.0.0 spec/setup/active_record.rb