Jonathan Weiss
2006-Jan-13 23:19 UTC
[Rails] Flash not cleared with ActiveRecord session store
Cheers,
I''ve stumbled over a bug with 1.0 and ActiveRecord store for session
while migrating from pstore sessions.
I created the table with `rake create_sessions_table` and set
`config.action_controller.session_store = :active_record_store` in
environment.rb.
Everything runs fine except that the flash messages will not be cleared.
I get the same message everytime on everypage I surf. E.g. if the
message is set through an `update` action I will see it from now on
forever (or until the controler sets a new one, than this one will get
displayed on every page).
When I change back to pstore (through editing environment.rb),
everything works fine again.
I confirmed this behaviour with my project on FreeBSD 6.0 and MacOSX
10.4 with MySQL 4/5.
Anybody also seeing this or not having trouble with flash and
ActiveRecord session store?
I have the login_engine installed and therefore have to display my flash
messages like this:
<% for name in [:notice, :warning, :message] %>
<% if flash[name] %>
<%= "<div id=\"flash\" class=\"flash\"
>#{flash[name]}</div>" %>
<% end %>
<% end %>
Jonathan
--
Jonathan Weiss
http://blog.innerewut.de
Jonathan Weiss
2006-Jan-14 18:06 UTC
[Rails] Flash not cleared with ActiveRecord session store
Jonathan Weiss wrote:> Cheers, > > > I''ve stumbled over a bug with 1.0 and ActiveRecord store for session > while migrating from pstore sessions. >I narrowed it down to render_component calls in the layout: <%= render_component(:controller => "region", :action => "stats")%> I use this for my sidebar and if I comment this out, everything is fine again. Disabling sessions in the called controller does not help. With pstore sessions, everything is fine, this problem exists only with ActiveRecord store. Jonathan -- Jonathan Weiss http://blog.innerewut.de
Jonathan Weiss
2006-Jan-23 15:04 UTC
[Rails] Flash not cleared with ActiveRecord session store
This bug is also apparent in a new project. Just create a new rails project and insert a render_component call in your layout. When you use ActiveRecord Session Store, the flash value will never be cleared. Jonathan -- Jonathan Weiss http://blog.innerewut.de Jonathan Weiss wrote:> Jonathan Weiss wrote: >> Cheers, >> >> >> I''ve stumbled over a bug with 1.0 and ActiveRecord store for session >> while migrating from pstore sessions. >> > > I narrowed it down to render_component calls in the layout: > > <%= render_component(:controller => "region", :action => "stats")%> > > I use this for my sidebar and if I comment this out, everything is fine > again. > > Disabling sessions in the called controller does not help. > > With pstore sessions, everything is fine, this problem exists only with > ActiveRecord store. > > Jonathan >
Stefan Kaes
2006-Jan-24 06:34 UTC
[Rails] Flash not cleared with ActiveRecord session store
Jonathan Weiss wrote:> This bug is also apparent in a new project. > > Just create a new rails project and insert a render_component call in > your layout. When you use ActiveRecord Session Store, the flash value > will never be cleared. > > > Jonathan >I think this problem will be fixed with this patch: http://dev.rubyonrails.org/ticket/3527 -- stefan -- For rails performance tuning, see: http://railsexpress.de/blog Subscription: http://railsexpress.de/blog/xml/rss20/feed.xml
Jonathan Weiss
2006-Jan-24 08:53 UTC
[Rails] Flash not cleared with ActiveRecord session store
Stefan Kaes wrote:> Jonathan Weiss wrote: >> This bug is also apparent in a new project. >> >> Just create a new rails project and insert a render_component call in >> your layout. When you use ActiveRecord Session Store, the flash value >> will never be cleared. >> >> >> Jonathan >> > I think this problem will be fixed with this patch: > http://dev.rubyonrails.org/ticket/3527 >Yes this fixes the problem! It also should close http://dev.rubyonrails.org/ticket/3194> -- stefan >Jonathan -- Jonathan Weiss http://blog.innerewut.de