Skip to content

Commit

Permalink
Merge pull request #1212 from collectiveidea/fix-proxy-object-depreca…
Browse files Browse the repository at this point in the history
…tion

Fix proxy object deprecation
  • Loading branch information
albus522 authored Aug 13, 2024
2 parents b66bb64 + 21b3dad commit 61cfd03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
12 changes: 0 additions & 12 deletions lib/delayed/compatibility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 7 additions & 1 deletion lib/delayed/message_sending.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 61cfd03

Please sign in to comment.