The implementation of TzTime uses: class TzTime class <<self attr_accessor :zone <snip> and then recommends doing this: class ApplicationController < ActionController::Base around_filter :set_timezone private def set_timezone TzTime.zone = current_user.time_zone yield TzTime.reset! end end Won''t this cause problems with concurrent requests for two users with different timezones? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
AFAIK Rails doesn''t do concurrent requests. On Jan 11, 9:43 pm, dailer <d.sai...-Wuw85uim5zDR7s880joybQ@public.gmane.org> wrote:> The implementation of TzTime uses: > > class TzTime > class <<self > attr_accessor :zone > <snip> > > and then recommends doing this: > > class ApplicationController < ActionController::Base > around_filter :set_timezone > > private > def set_timezone > TzTime.zone = current_user.time_zone > yield > TzTime.reset! > end > end > > Won''t this cause problems with concurrent requests for two users with > different timezones?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rails is not thread safe. Thats why we have to use mongrel_cluster . I believe Merb IS threaded if you''re worried about concurrency. It is also a lot faster! On Jan 12, 3:14 am, Robert Walker <rwalker...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> AFAIK Rails doesn''t do concurrent requests. > > On Jan 11, 9:43 pm, dailer <d.sai...-Wuw85uim5zDR7s880joybQ@public.gmane.org> wrote: > > > The implementation of TzTime uses: > > > class TzTime > > class <<self > > attr_accessor :zone > > <snip> > > > and then recommends doing this: > > > class ApplicationController < ActionController::Base > > around_filter :set_timezone > > > private > > def set_timezone > > TzTime.zone = current_user.time_zone > > yield > > TzTime.reset! > > end > > end > > > Won''t this cause problems with concurrent requests for two users with > > different timezones?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---