Permalink
Browse files

use 'use_zone' method in example, instead of reimplementing it

  • Loading branch information...
Jakub Kuźma
Jakub Kuźma committed Jul 10, 2012
1 parent 9650d95 commit 897f8f54532b77161e4b874f205277b432e8c023
Showing with 5 additions and 5 deletions.
  1. +5 −5 activesupport/lib/active_support/core_ext/time/zones.rb
@@ -27,11 +27,11 @@ def zone
# around_filter :set_time_zone
#
# def set_time_zone
- # old_time_zone = Time.zone
- # Time.zone = current_user.time_zone if logged_in?
- # yield
- # ensure
- # Time.zone = old_time_zone
+ # if logged_in?
+ # Time.use_zone(current_user.time_zone) { yield }
+ # else
+ # yield
+ # end
# end
# end
def zone=(time_zone)

0 comments on commit 897f8f5

Please sign in to comment.