lib/reactor/subscription.rb in reactor-0.14.0 vs lib/reactor/subscription.rb in reactor-0.15.0
- old
+ new
@@ -27,11 +27,11 @@
build_worker_class
end
def handler_defined?
namespace.const_defined?(handler_name) &&
- namespace.const_get(handler_name).ancestors.include?(Reactor.subscriber_namespace)
+ namespace.const_get(handler_name).parents.include?(Reactor.subscriber_namespace)
end
def event_handler_names
@event_handler_names ||= []
end
@@ -66,11 +66,10 @@
!!options[:async]
end
end
def build_worker_class
- return @worker_class = namespace.const_get(handler_name) if handler_defined?
-
+ namespace.send(:remove_const, handler_name) if handler_defined?
worker_class = mailer_subscriber? ? build_mailer_worker : build_event_worker
namespace.const_set(handler_name, worker_class)
@worker_class = namespace.const_get(handler_name)
end