diff --git a/lib/delayed/compatibility.rb b/lib/delayed/compatibility.rb index 72778f9cc..0ef949b7a 100644 --- a/lib/delayed/compatibility.rb +++ b/lib/delayed/compatibility.rb @@ -3,25 +3,13 @@ module Delayed module Compatibility if ActiveSupport::VERSION::MAJOR >= 4 - require 'active_support/proxy_object' - def self.executable_prefix 'bin' end - - def self.proxy_object_class - ActiveSupport::ProxyObject - end else - require 'active_support/basic_object' - def self.executable_prefix 'script' end - - def self.proxy_object_class - ActiveSupport::BasicObject - end end end end diff --git a/lib/delayed/message_sending.rb b/lib/delayed/message_sending.rb index a2808fd39..6e1e834a1 100644 --- a/lib/delayed/message_sending.rb +++ b/lib/delayed/message_sending.rb @@ -1,5 +1,11 @@ module Delayed - class DelayProxy < Delayed::Compatibility.proxy_object_class + class DelayProxy < BasicObject + undef_method :== + undef_method :equal? + + # Let DelayProxy raise exceptions. + define_method(:raise, ::Object.instance_method(:raise)) + def initialize(payload_class, target, options) @payload_class = payload_class @target = target