diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-21 16:55:04 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-21 16:55:04 -0700 |
commit | 87a319cd0c51cbc8f6bc8e3d11ab9e30a96ac628 (patch) | |
tree | 6def8b66cac5408333fa0cad4198a6f787f81dda /activerecord/lib/active_record | |
parent | f5de56f53768bf07a337c9bf32b397a9d3e61cf0 (diff) | |
download | rails-87a319cd0c51cbc8f6bc8e3d11ab9e30a96ac628.tar.gz rails-87a319cd0c51cbc8f6bc8e3d11ab9e30a96ac628.tar.bz2 rails-87a319cd0c51cbc8f6bc8e3d11ab9e30a96ac628.zip |
testing new_record? and converting to an attribute
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/session_store.rb | 8 |
1 files changed, 3 insertions, 5 deletions
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 |