Add namespace check

This commit is contained in:
sanemat committed 2012-10-11 09:23:53 +09:00
1 parent 92a074bc18
commit f9ccc6efdf
1 file changed
+4 -1
+4 -1
View File
@@ -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 <<self
alias :load :decode