lib/delayed/performable_method.rb in delayed_job-4.1.1 vs lib/delayed/performable_method.rb in delayed_job-4.1.2
- old
+ new
@@ -1,13 +1,9 @@
-require 'active_support/core_ext/module/delegation'
-
module Delayed
class PerformableMethod
attr_accessor :object, :method_name, :args
- delegate :method, :to => :object
-
def initialize(object, method_name, args)
raise NoMethodError, "undefined method `#{method_name}' for #{object.inspect}" unless object.respond_to?(method_name, true)
if object.respond_to?(:persisted?) && !object.persisted?
raise(ArgumentError, "job cannot be created for non-persisted record: #{object.inspect}")
@@ -26,9 +22,13 @@
end
end
def perform
object.send(method_name, *args) if object
+ end
+
+ def method(sym)
+ object.method(sym)
end
def method_missing(symbol, *args)
object.send(symbol, *args)
end