summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-30 10:46:09 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-30 10:46:09 +0000
commit5bc7dc77e24a947a005625971c42d20d6bdf8e5b (patch)
treedf6bd3541a156468ec751ae6ef9d6bb1dc0dd676
parent9a1b46fe42873c5fa4c8bb9cf6755eed9e8315db (diff)
downloadredmine-5bc7dc77e24a947a005625971c42d20d6bdf8e5b.tar.gz
redmine-5bc7dc77e24a947a005625971c42d20d6bdf8e5b.zip
Do not store query object in session but id or filters only. This allows to use Rails 2.0 cookie based sessions.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1027 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/issues_controller.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index be854f98e..39a1e2d13 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -216,9 +216,9 @@ private
def retrieve_query
if params[:query_id]
@query = Query.find(params[:query_id], :conditions => {:project_id => (@project ? @project.id : nil)})
- session[:query] = @query
+ session[:query] = {:id => @query.id, :project_id => @query.project_id}
else
- if params[:set_filter] or !session[:query] or session[:query].project != @project
+ if params[:set_filter] || session[:query].nil? || session[:query][:project_id] != (@project ? @project.id : nil)
# Give it a name, required to be valid
@query = Query.new(:name => "_")
@query.project = @project
@@ -231,9 +231,10 @@ private
@query.add_short_filter(field, params[field]) if params[field]
end
end
- session[:query] = @query
+ session[:query] = {:project_id => @query.project_id, :filters => @query.filters}
else
- @query = session[:query]
+ @query = Query.find_by_id(session[:query][:id]) if session[:query][:id]
+ @query ||= Query.new(:name => "_", :project => @project, :filters => session[:query][:filters])
end
end
end