Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove a few other traces of Rails 2

  • Loading branch information...
commit 7232cf1f548aa7913a539a9bd1fd321d80d25706 1 parent f91dda3
@bkeepers bkeepers authored
Showing with 4 additions and 13 deletions.
  1. +4 −11 lib/delayed/backend/active_record.rb
  2. +0 −2  spec/spec_helper.rb
View
15 lib/delayed/backend/active_record.rb
@@ -25,17 +25,10 @@ class Job < ::ActiveRecord::Base
before_save :set_default_run_at
- if ::ActiveRecord::VERSION::MAJOR >= 3
- scope :ready_to_run, lambda {|worker_name, max_run_time|
- where(['(run_at <= ? AND (locked_at IS NULL OR locked_at < ?) OR locked_by = ?) AND failed_at IS NULL', db_time_now, db_time_now - max_run_time, worker_name])
- }
- scope :by_priority, order('priority ASC, run_at ASC')
- else
- named_scope :ready_to_run, lambda {|worker_name, max_run_time|
- {:conditions => ['(run_at <= ? AND (locked_at IS NULL OR locked_at < ?) OR locked_by = ?) AND failed_at IS NULL', db_time_now, db_time_now - max_run_time, worker_name]}
- }
- named_scope :by_priority, :order => 'priority ASC, run_at ASC'
- end
+ scope :ready_to_run, lambda {|worker_name, max_run_time|
+ where(['(run_at <= ? AND (locked_at IS NULL OR locked_at < ?) OR locked_by = ?) AND failed_at IS NULL', db_time_now, db_time_now - max_run_time, worker_name])
+ }
+ scope :by_priority, order('priority ASC, run_at ASC')
def self.after_fork
::ActiveRecord::Base.connection.reconnect!
View
2  spec/spec_helper.rb
@@ -5,8 +5,6 @@
require 'spec'
require 'logger'
-gem 'activerecord', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
-
require 'delayed_job'
require 'delayed/backend/shared_spec'
Please sign in to comment.
Something went wrong with that request. Please try again.