aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-07-21 16:52:15 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-21 16:52:15 -0700
commitf5de56f53768bf07a337c9bf32b397a9d3e61cf0 (patch)
tree213e6b78ac6b317c778bc53d31d18d391fcc381b /activerecord
parent4e6cf429a16ce824b18bb8f494dbcbf5931a615d (diff)
downloadrails-f5de56f53768bf07a337c9bf32b397a9d3e61cf0.tar.gz
rails-f5de56f53768bf07a337c9bf32b397a9d3e61cf0.tar.bz2
rails-f5de56f53768bf07a337c9bf32b397a9d3e61cf0.zip
reducing function calls in the session store
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/session_store.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/session_store.rb b/activerecord/lib/active_record/session_store.rb
index a0a9368c12..5de812962a 100644
--- a/activerecord/lib/active_record/session_store.rb
+++ b/activerecord/lib/active_record/session_store.rb
@@ -138,17 +138,17 @@ module ActiveRecord
private
def marshal_data!
- return false if !loaded?
- write_attribute(@@data_column_name, self.class.marshal(self.data))
+ return false unless loaded?
+ write_attribute(@@data_column_name, self.class.marshal(data))
end
# Ensures that the data about to be stored in the database is not
# larger than the data storage column. Raises
# ActionController::SessionOverflowError.
def raise_on_session_data_overflow!
- return false if !loaded?
+ return false unless loaded?
limit = self.class.data_column_size_limit
- if loaded? and limit and read_attribute(@@data_column_name).size > limit
+ if limit and read_attribute(@@data_column_name).size > limit
raise ActionController::SessionOverflowError
end
end
@@ -265,7 +265,7 @@ module ActiveRecord
end
def save
- return false if !loaded?
+ return false unless loaded?
marshaled_data = self.class.marshal(data)
if @new_record