From 8657aea37af901646c3783e8c0fa6a706607b926 Mon Sep 17 00:00:00 2001 From: Luismi Cavalle Date: Sun, 30 Sep 2012 17:09:42 +0100 Subject: [PATCH] Allow delay of any module class method --- lib/sidekiq/extensions/class_methods.rb | 2 +- test/test_extensions.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/sidekiq/extensions/class_methods.rb b/lib/sidekiq/extensions/class_methods.rb index 67dd04d7..b3778d7d 100644 --- a/lib/sidekiq/extensions/class_methods.rb +++ b/lib/sidekiq/extensions/class_methods.rb @@ -30,4 +30,4 @@ module Sidekiq end end -Class.send(:include, Sidekiq::Extensions::Klass) +Module.send(:include, Sidekiq::Extensions::Klass) diff --git a/test/test_extensions.rb b/test/test_extensions.rb index 4ce60d10..a239d70d 100644 --- a/test/test_extensions.rb +++ b/test/test_extensions.rb @@ -63,5 +63,14 @@ class TestExtensions < MiniTest::Unit::TestCase it 'allows delay of any ole class method' do SomeClass.delay.doit(Date.today) end + + module SomeModule + def self.doit(arg) + end + end + + it 'allows delay of any module class method' do + SomeModule.delay.doit(Date.today) + end end end