From f9ccc6efdfb8ec6548e5e1d28a122f5ae5fb3f93 Mon Sep 17 00:00:00 2001 From: sanemat Date: Thu, 11 Oct 2012 09:23:53 +0900 Subject: [PATCH] Add namespace check --- lib/compat/multi_json.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/compat/multi_json.rb b/lib/compat/multi_json.rb index 533938567..e62de7640 100644 --- a/lib/compat/multi_json.rb +++ b/lib/compat/multi_json.rb @@ -1,7 +1,10 @@ gem 'multi_json', '>= 1.0.0' require 'multi_json' -if !MultiJson.respond_to?(:load) || [Kernel, ActiveSupport::Dependencies::Loadable].include?(MultiJson.method(:load).owner) +if !MultiJson.respond_to?(:load) || [ + defined?(Kernel) && Kernel, + defined?(ActiveSupport::Dependencies::Loadable) && ActiveSupport::Dependencies::Loadable +].compact.include?(MultiJson.method(:load).owner) module MultiJson class <