From bdbe390a98acbebcfd48dca28c79d3296c8d3981 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 21 Jul 2010 16:01:41 -0700 Subject: initializing instance variables --- activerecord/lib/active_record/session_store.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/session_store.rb b/activerecord/lib/active_record/session_store.rb index 0c2db4156b..feb9e2e8f6 100644 --- a/activerecord/lib/active_record/session_store.rb +++ b/activerecord/lib/active_record/session_store.rb @@ -119,6 +119,11 @@ module ActiveRecord end end + def initialize(attributes = nil) + @data = nil + super + end + # Lazy-unmarshal session state. def data @data ||= self.class.unmarshal(read_attribute(@@data_column_name)) || {} @@ -128,7 +133,7 @@ module ActiveRecord # Has the session been loaded yet? def loaded? - !!@data + @data end private -- cgit v1.2.3