From c00bf5f0c62f72f84629c6873791a591c02ae62c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 17 Feb 2005 01:23:41 +0000 Subject: Fixed the verbosity of using the AR store git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@639 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/session/active_record_store.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/session/active_record_store.rb b/actionpack/lib/action_controller/session/active_record_store.rb index 27ef869132..9e0db037d0 100644 --- a/actionpack/lib/action_controller/session/active_record_store.rb +++ b/actionpack/lib/action_controller/session/active_record_store.rb @@ -29,8 +29,10 @@ class CGI # # This session's ActiveRecord database row will be created if it does not exist, or opened if it does. def initialize(session, option=nil) - @session = Session.find_by_sessid(session.session_id) || Session.new("sessid" => session.session_id, "data" => {}) - @data = @session.data + ActiveRecord::Base.silence do + @session = Session.find_by_sessid(session.session_id) || Session.new("sessid" => session.session_id, "data" => {}) + @data = @session.data + end end # Update and close the session's ActiveRecord object. @@ -56,7 +58,7 @@ class CGI # Save session state in the session's ActiveRecord object. def update return unless @session - ActiveRecord::Base.benchmark("Saving session") { @session.update_attribute "data", @data } + ActiveRecord::Base.silence { @session.update_attribute "data", @data } end end #ActiveRecordStore end #Session -- cgit v1.2.3