aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/session_store.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/session_store.rb')
-rw-r--r--activerecord/lib/active_record/session_store.rb7
1 files changed, 6 insertions, 1 deletions
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