From e9a75451236119e1db3e5d7cc7703637d048c7f8 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 20 May 2009 18:11:06 -0700 Subject: Avoid uninitialized instance variable warning --- activesupport/lib/active_support/json.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/json.rb b/activesupport/lib/active_support/json.rb index 1e8ded12da..6d845182fb 100644 --- a/activesupport/lib/active_support/json.rb +++ b/activesupport/lib/active_support/json.rb @@ -43,10 +43,10 @@ module ActiveSupport delegate :decode, :to => :backend def backend - @backend || begin + unless defined? @backend self.backend = defined?(::JSON) ? "JSONGem" : "Yaml" - @backend end + @backend end def backend=(name) -- cgit v1.2.3