1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Removes the generic aliases which MAY clash with names of already declared by other applications

This commit is contained in:
Devaroop 2014-04-24 19:41:05 +05:30
parent 03823ae13a
commit e5687d7184

View file

@ -9,6 +9,21 @@ module Sidekiq
end
end
# Removes the generic aliases which MAY clash with names of already
# created methods by other applications. The methods `sidekiq_delay`,
# `sidekiq_delay_for` and `sidekiq_delay_until` can be used instead.
def self.namespace_delay_methods
[Extensions::ActiveRecord,
Extensions::ActionMailer,
Extensions::Klass].each do |mod|
mod.module_eval do
remove_method :delay if respond_to?(:delay)
remove_method :delay_for if respond_to?(:delay_for)
remove_method :delay_until if respond_to?(:delay_until)
end
end
end
class Rails < ::Rails::Engine
config.autoload_paths << File.expand_path("#{config.root}/app/workers") if File.exist?("#{config.root}/app/workers")