aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorJakub Kuźma <qoobaa@gmail.com>2012-07-10 10:02:28 +0200
committerJakub Kuźma <qoobaa@gmail.com>2012-07-10 10:02:28 +0200
commit897f8f54532b77161e4b874f205277b432e8c023 (patch)
treeab35062b45a56fd058c001a6a183d6b28165603b /activesupport/lib
parent9650d95457279006918ec094b10000acc130375f (diff)
downloadrails-897f8f54532b77161e4b874f205277b432e8c023.tar.gz
rails-897f8f54532b77161e4b874f205277b432e8c023.tar.bz2
rails-897f8f54532b77161e4b874f205277b432e8c023.zip
use 'use_zone' method in example, instead of reimplementing it
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/time/zones.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/core_ext/time/zones.rb b/activesupport/lib/active_support/core_ext/time/zones.rb
index e48866abe3..1e43c1ef7a 100644
--- a/activesupport/lib/active_support/core_ext/time/zones.rb
+++ b/activesupport/lib/active_support/core_ext/time/zones.rb
@@ -27,11 +27,11 @@ class Time
# 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)