From 4ce824828125c205558acdf050c612a317150a4f Mon Sep 17 00:00:00 2001 From: mhgoldman Date: Tue, 10 Dec 2019 09:54:26 -0500 Subject: [PATCH] Don't wipe out HookSet if previously initialized --- lib/hooks.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/hooks.rb b/lib/hooks.rb index 2cef375..f0ef1e1 100644 --- a/lib/hooks.rb +++ b/lib/hooks.rb @@ -23,7 +23,7 @@ def self.included(base) extend Uber::InheritableAttr extend ClassMethods inheritable_attr :_hooks - self._hooks= HookSet.new + self._hooks ||= HookSet.new end end @@ -133,4 +133,4 @@ def clone end end -require "hooks/instance_hooks" \ No newline at end of file +require "hooks/instance_hooks"