From 87a319cd0c51cbc8f6bc8e3d11ab9e30a96ac628 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 21 Jul 2010 16:55:04 -0700 Subject: testing new_record? and converting to an attribute --- activerecord/lib/active_record/session_store.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/session_store.rb b/activerecord/lib/active_record/session_store.rb index 5de812962a..17f09d64b0 100644 --- a/activerecord/lib/active_record/session_store.rb +++ b/activerecord/lib/active_record/session_store.rb @@ -231,7 +231,9 @@ module ActiveRecord end end - attr_reader :session_id + attr_reader :session_id, :new_record + alias :new_record? :new_record + attr_writer :data # Look for normal and marshaled data, self.find_by_session_id's way of @@ -244,10 +246,6 @@ module ActiveRecord @new_record = @marshaled_data.nil? end - def new_record? - @new_record - end - # Lazy-unmarshal session state. def data unless @data -- cgit v1.2.3