ruby - weird ActiveRecord time zone behavior in Rails on multiple servers -
our application hosted on aws 8 app servers (unicorn) + 3 rds (1 master + 2 read replica) + 2 redis (master + slave) located in 1 region 8 app servers have bst time zone , 2 redis, have applied time zone 'london' in application.rb,
the problem on show page start date, end date displayed value displayed start date friday 01-10-2015 - 18:30 , friday 01-10-2015 - 19:30 value reflect of refresh (ctrl + f5).
has faced similar problem?
ravi
you can fix issue, adding around filter
in application_controller
override weird behaviour of active_record
- timezone.
around_filter :use_time_zone private def use_time_zone(&block) time.use_zone('london', &block) end
so, whenever default timezone changed utc, override , set bst.
Comments
Post a Comment