From f8e92f282c9609b39ac058b661c86bd7de60a87a Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Tue, 24 Apr 2012 20:54:55 -0700 Subject: [PATCH] Rails hooks should also work on server-side, #152 --- Changes.md | 5 +++++ lib/sidekiq.rb | 2 +- lib/sidekiq/cli.rb | 2 ++ lib/sidekiq/version.rb | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Changes.md b/Changes.md index c8222530..8f357988 100644 --- a/Changes.md +++ b/Changes.md @@ -1,3 +1,8 @@ +1.1.5 +----------- + +- Fix delayed extensions not available in Workers [#152] + 1.1.4 ----------- diff --git a/lib/sidekiq.rb b/lib/sidekiq.rb index 8aa45915..c67875ce 100644 --- a/lib/sidekiq.rb +++ b/lib/sidekiq.rb @@ -1,12 +1,12 @@ require 'sidekiq/version' require 'sidekiq/client' require 'sidekiq/worker' -require 'sidekiq/rails' require 'sidekiq/redis_connection' require 'sidekiq/util' require 'sidekiq/extensions/action_mailer' require 'sidekiq/extensions/active_record' +require 'sidekiq/rails' if defined?(::Rails) module Sidekiq diff --git a/lib/sidekiq/cli.rb b/lib/sidekiq/cli.rb index d22c8743..7dc96b94 100644 --- a/lib/sidekiq/cli.rb +++ b/lib/sidekiq/cli.rb @@ -93,6 +93,8 @@ module Sidekiq raise ArgumentError, "#{options[:require]} does not exist" unless File.exist?(options[:require]) if File.directory?(options[:require]) + require 'rails' + require 'sidekiq/rails' require File.expand_path("#{options[:require]}/config/environment.rb") ::Rails.application.eager_load! else diff --git a/lib/sidekiq/version.rb b/lib/sidekiq/version.rb index e7c7298f..6bb173b6 100644 --- a/lib/sidekiq/version.rb +++ b/lib/sidekiq/version.rb @@ -1,3 +1,3 @@ module Sidekiq - VERSION = "1.1.4" + VERSION = "1.1.5" end