Sha256: 9bb7ba6c53c1e0d494eece959ce08320ecc45bb9bbb1c2dcc0b33fd28a359e25

Contents?: true

Size: 1.06 KB

Versions: 13

Compression:

Stored size: 1.06 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

require 'delayed_job'
begin
  require 'active_record'
rescue LoadError
  # Let it fail, might be working with another library
end

# Deprecated on some versions, required on others. Hurray!
Delayed::Worker.guess_backend

if Delayed::Worker.backend.to_s == "Delayed::Backend::ActiveRecord::Job"
  $db_connection = ActiveRecord::Base.establish_connection(:adapter  => "sqlite3",
                                                           :database => ":memory:")

  begin
    require 'generators/delayed_job/templates/migration'
  rescue MissingSourceFile
    # Back on DJ v2 the generators aren't in the lib folder so we have to do some
    # sneaky stuff to get them loaded. Still better than dup'ing them, though.
    dj_dir = ($:).grep(/delayed_job-/).first
    require "#{dj_dir}/../generators/delayed_job/templates/migration"
  end

  class CreateDelayedJobs
    @connection = $db_connection
  end

  CreateDelayedJobs.up
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
newrelic_rpm-3.14.0.305 test/multiverse/suites/delayed_job/before_suite.rb
newrelic_rpm-3.13.2.302 test/multiverse/suites/delayed_job/before_suite.rb
newrelic_rpm-3.13.1.300 test/multiverse/suites/delayed_job/before_suite.rb
newrelic_rpm-3.13.0.299 test/multiverse/suites/delayed_job/before_suite.rb
newrelic_rpm-3.12.1.298 test/multiverse/suites/delayed_job/before_suite.rb
newrelic_rpm-3.12.0.288 test/multiverse/suites/delayed_job/before_suite.rb
newrelic_rpm-3.11.2.286 test/multiverse/suites/delayed_job/before_suite.rb
newrelic_rpm-3.11.1.284 test/multiverse/suites/delayed_job/before_suite.rb
newrelic_rpm-3.11.0.283 test/multiverse/suites/delayed_job/before_suite.rb
newrelic_rpm-3.10.0.279 test/multiverse/suites/delayed_job/before_suite.rb
newrelic_rpm-3.9.9.275 test/multiverse/suites/delayed_job/before_suite.rb
newrelic_rpm-3.9.8.273 test/multiverse/suites/delayed_job/before_suite.rb
newrelic_rpm-3.9.7.266 test/multiverse/suites/delayed_job/before_suite.rb