From 53a90b6d5c38445c9d3ffdb5b847aa9aa6c377ee Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 24 Jan 2013 01:46:37 +0100 Subject: [PATCH] Improved state_check(). --- app/models/setting.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/setting.rb b/app/models/setting.rb index 34995747e..3b590ddbe 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -54,7 +54,7 @@ class Setting < ApplicationModel end def state_check if self.state - if !self.state.has_key?(:value) + if !self.state.respond_to?('has_key?') || !self.state.has_key?(:value) self.state = { :value => self.state } end end