diff options
author | Jakub Kuźma <qoobaa@gmail.com> | 2012-07-10 10:02:28 +0200 |
---|---|---|
committer | Jakub Kuźma <qoobaa@gmail.com> | 2012-07-10 10:02:28 +0200 |
commit | 897f8f54532b77161e4b874f205277b432e8c023 (patch) | |
tree | ab35062b45a56fd058c001a6a183d6b28165603b | |
parent | 9650d95457279006918ec094b10000acc130375f (diff) | |
download | rails-897f8f54532b77161e4b874f205277b432e8c023.tar.gz rails-897f8f54532b77161e4b874f205277b432e8c023.tar.bz2 rails-897f8f54532b77161e4b874f205277b432e8c023.zip |
use 'use_zone' method in example, instead of reimplementing it
-rw-r--r-- | activesupport/lib/active_support/core_ext/time/zones.rb | 10 |
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) |