Improved state_check().

This commit is contained in:
Martin Edenhofer 2013-01-24 01:46:37 +01:00
parent 272a476b09
commit 53a90b6d5c

View file

@ -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